Re: Deadlock when using SslFilter and ProxyFilter together

2016-02-09 Thread Jonathan Valliere
Obviously something is wrong with the thread-safe operation the write stack.  
If it was thread safe then there is no need to ever have locks in the filter 
chain unless you have an executor filter. 

1027 exposes a bug in the lock routines of IoSession

Sent from my iPhone

> On Feb 9, 2016, at 12:48 PM, Emmanuel Lécharny  wrote:
> 
> Le 09/02/16 18:22, Jon V. a écrit :
>> Its my understanding that Read and Write operations are thread-safe and
>> should never cause deadlocks. (not sure why there are locks in those
>> filters)
>> 
>> Also, I don’t think SSL should be after Proxy.  You cannot initiate an SSL
>> session if you proxy the setup routine.  What is the goal in this setup?
>> 
>> Please send us the deadlock thread trace.(You can get it from VisualVM)
> 
> I think this is a pb that is already exposed in DIRMINA-1027.
> 
> I still have to find a couple of hours to analyse the code and find a
> solution.
> 


Re: Deadlock when using SslFilter and ProxyFilter together

2016-02-09 Thread Jon V.
Its my understanding that Read and Write operations are thread-safe and
should never cause deadlocks. (not sure why there are locks in those
filters)

Also, I don’t think SSL should be after Proxy.  You cannot initiate an SSL
session if you proxy the setup routine.  What is the goal in this setup?

Please send us the deadlock thread trace.(You can get it from VisualVM)

On Tue, Feb 9, 2016 at 11:59 AM, Norbert Irmer  wrote:

> Hello,
>
> I detected a deadlock when using Proxies and Ssl together.
>
> The SslFilter and the ProxyFilzter both have synchronized blocks, and when
> sending
> and receiving messages you get deadlocks.
>
> The SslFilter hangs in "sslLock.lock()" in
> "SslHandler.flushScheduledEvents()",
> while the ProxyFilter hangs in "synchronized(handler)" in
> "ProxyFilter.writeData".
>
> That sending and receiving messages with both filters simultaneously leads
> to a deadlock
> is clear, since both filters have locks and data flow direction is
> reversed when reading and writing:
>
> Read direction:   Socket  --> ProxyFilter   ---> SslFilter  -->
> FixProtocol   --> Application
> Write direction:  Socket <-- ProxyFilter  <---  SslFilter  <--
> FixProtocol  <-- Application
>
>
>
>


Re: Deadlock when using SslFilter and ProxyFilter together

2016-02-09 Thread Emmanuel Lécharny
Le 09/02/16 18:22, Jon V. a écrit :
> Its my understanding that Read and Write operations are thread-safe and
> should never cause deadlocks. (not sure why there are locks in those
> filters)
>
> Also, I don’t think SSL should be after Proxy.  You cannot initiate an SSL
> session if you proxy the setup routine.  What is the goal in this setup?
>
> Please send us the deadlock thread trace.(You can get it from VisualVM)

I think this is a pb that is already exposed in DIRMINA-1027.

I still have to find a couple of hours to analyse the code and find a
solution.