Re: Deadlock when using SslFilter and ProxyFilter together

2016-02-11 Thread Norbert Irmer
If you look at the stacktraces, I sent in my previous mails, you see, that the order, in which the filters are called, is right: When receiving: ... at org.apache.mina.filter.ssl.SslHandler.flushScheduledEvents(SslHandler.java:310) <--- SslFilter at

Re: Deadlock when using SslFilter and ProxyFilter together

2016-02-11 Thread Emmanuel Lécharny
Le 11/02/16 10:10, Norbert Irmer a écrit : > If you look at the stacktraces, I sent in my previous mails, you see, that > the order, in which the > filters are called, is right: > > When receiving: > > ... > at > org.apache.mina.filter.ssl.SslHandler.flushScheduledEvents(SslHandler.java:310) >

Re: Deadlock when using SslFilter and ProxyFilter together

2016-02-11 Thread Norbert Irmer
> The new version I have put on http://people.apache.org/~elecharny should > solve the problem : instead of getting the lock whe we enter in the > flushScheduledEvents() event, we exit immediately, doing nothing but > incrementing the number of scheduled-events, instead of getting the > lock.

Re: Deadlock when using SslFilter and ProxyFilter together

2016-02-11 Thread Emmanuel Lécharny
Le 11/02/16 17:38, Norbert Irmer a écrit : > >> The new version I have put on http://people.apache.org/~elecharny should >> solve the problem : instead of getting the lock whe we enter in the >> flushScheduledEvents() event, we exit immediately, doing nothing but >> incrementing the number of

Re: Deadlock when using SslFilter and ProxyFilter together

2016-02-10 Thread Norbert Irmer
> seems like you have installed the proxy filter before the ssl filter in > your chain. Can you do the opposite ? I don't build the chain manually, I simply use a "ProxyConnector" (from package "org.apache.mina.proxy") to make a proxy connection (this also explains, why I had the

Re: Deadlock when using SslFilter and ProxyFilter together

2016-02-10 Thread Norbert Irmer
> Ok, but you can insert teh SslFilter *before* the proxyFilter. Once you > get the ProxyConnector instance, get the connector and do : Well, I am using a patched QuickFixJ version, in which the control flow is a bit different. Here is an excerpt from the code they are using:

Re: Deadlock when using SslFilter and ProxyFilter together

2016-02-10 Thread Emmanuel Lécharny
Le 10/02/16 16:37, Norbert Irmer a écrit : >> seems like you have installed the proxy filter before the ssl filter in >> your chain. Can you do the opposite ? > I don't build the chain manually, I simply use a "ProxyConnector" (from > package "org.apache.mina.proxy") > to make a proxy connection

Re: Deadlock when using SslFilter and ProxyFilter together

2016-02-10 Thread Emmanuel Lécharny
Le 10/02/16 18:16, Norbert Irmer a écrit : >> Ok, but you can insert teh SslFilter *before* the proxyFilter. Once you >> get the ProxyConnector instance, get the connector and do : > > Well, I am using a patched QuickFixJ version, in which the control flow is a > bit different. > > Here is an

Re: Deadlock when using SslFilter and ProxyFilter together

2016-02-10 Thread Jon V.
I would have thought the reason SSL Filter needs to be before Proxy is because the SSL handshaking from the client side would get proxied away from the SSL Filter. On Wed, Feb 10, 2016 at 12:57 PM, Emmanuel Lécharny wrote: > Le 10/02/16 18:16, Norbert Irmer a écrit : > >>

Re: Deadlock when using SslFilter and ProxyFilter together

2016-02-10 Thread Emmanuel Lécharny
Le 10/02/16 10:08, Norbert Irmer a écrit : > I attached a stacktrace of the two threads, which are in a deadlock. > > Jon maybe right, when saying the write stack is threadsafe, the problem is, > that simultaneously > a read operation is going on, and both stacks use the same filters. The stakcs

Re: Deadlock when using SslFilter and ProxyFilter together

2016-02-10 Thread Norbert Irmer
I attached a stacktrace of the two threads, which are in a deadlock. Jon maybe right, when saying the write stack is threadsafe, the problem is, that simultaneously a read operation is going on, and both stacks use the same filters. Thread "NioProcessor-2": flushScheduledEvents():308,

Re: Deadlock when using SslFilter and ProxyFilter together

2016-02-10 Thread Norbert Irmer
Hello, I did a "threaddump" with visualvm in the deadlock situation (not sure if this is what you wanted, but I don't see anything else), it shows the same deadlock situation (at the bottom of this mail), as in my previous mail. 2016-02-10 13:04:58 Full thread dump Java HotSpot(TM) 64-Bit

Re: Deadlock when using SslFilter and ProxyFilter together

2016-02-10 Thread Emmanuel Lécharny
Le 10/02/16 13:11, Norbert Irmer a écrit : > Hello, > > I did a "threaddump" with visualvm in the deadlock situation (not sure if > this is what you wanted, but I don't see > anything else), it shows the same deadlock situation (at the bottom of this > mail), as in my previous mail. Thanks !

Re: Deadlock when using SslFilter and ProxyFilter together

2016-02-10 Thread Emmanuel Lécharny
Le 10/02/16 22:11, Jon V. a écrit : > I would have thought the reason SSL Filter needs to be before Proxy is > because the SSL handshaking from the client side would get proxied away > from the SSL Filter. That too. But all in all, the handshake is just an exchange of data, as any other data

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

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?

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