Repository navigation
DIRMINA-1205 - deadlock when using SSL in combination with proxy filter - #84
Conversation
1ca6657 to
e6469bf
Compare
3768266 to
f2d3ce6
Compare
f2d3ce6 to
631e82f
Compare
|
I'll take some time this week-end to review this fix. Do you consider this fix serious enough that it requires a release? Seems so to me... |
|
I think this PR is stable now and I will mark it for review as soon as the sluggish ubuntu will pick up the job. Additional deadlock flow graphs attached to JIRA. Notes
Possibly, but as mentioned for G0 handler + PROXY combination is an existing bug. We detected this in QuickFIXj end-to-end proxy test suite (we had only G1 handler covered). |
|
I'll check this later but I would like to caution everyone. This is the exact class of problem that was brought up two years ago that led to the experimentation branch which introduced the buggy concurrency. |
Are you referring to Obviously the issue is there and needs to be addressed in one way or another. Possibly causing some other, undiscovered issues in the meantime until we get it right. My first attempt was to fix it inside G0 / G1 handlers, but I don't really want to touch G0 especially. |
I'm referring to my work in G1 and the removal of the synchronized blocks which led to #77 you brought up. G0 would never support the pattern of having an same-thread consumer blocking on the write operation because it essentially holds both the read and write locks simultaneously. I'd appreciate a week or so for us to discuss and review the problem. I have a little bit of a time availability problem the next few days. |
|
Sure. This is more complex problem and I will not merge it without a proper review. Have a look especially at the test + the attachments https://issues.apache.org/jira/projects/DIRMINA/issues/DIRMINA-1205 - the flow will be easier to understand. G0 + proxy is also broken (before 2.2.10). |
|
Any chance to get this reviewed soonish? I am fairly confident that the fix works. If it doesn't or breaks something else more patches in future will follow. I'm more concerned about introducing mentioned AI generated code for proxy end-to-end testing. I'm ok with this as long as it is commented, but you might not share the same view. |
| // Pass on any remaining data to the next filter | ||
| if (buf.hasRemaining()) { | ||
| forward = buf.hasRemaining(); | ||
|
|
There was a problem hiding this comment.
I would move the logs out of the sync section.
| } | ||
|
|
||
| handler.enqueueWriteRequest(nextFilter, writeRequest); | ||
| forward = false; |
There was a problem hiding this comment.
Move the forward = false out of the if, it's always false when the handshake has not been completed
elecharny
left a comment
There was a problem hiding this comment.
The logic being that we don't forward a message if the HS has not been completed sounds properly implemented with your patch.
Thanks!
|
Sounds good to me! Thanks for the effort! PS: at some point, we may need to put down on "paper" the internal logic around the SSLFilter. |
|
We probably can be aid with some AI. Any chance of getting 2.2.x becoming master? |
|
Hi @the-thing, I just changed the default branch to mina-2.2.X. |
|
Thanks. The new branch doesn't have the latest proxy filter patch - 1c80f9c |
|
Also I think I deleted 2.2.X (the old one) from the branches by accident. Somehow I thought this was a stale branch on my local fork. Still the mina-2.2.X is this PR behind. |
|
Hi, doesn't matter, 2.2.X is just a tag all in all. |
|
Thanks. I opened draft PR just in case. |
While updating MINA 2.2.10 in QuickFIXj we encountered a deadlock in end-to-end SOCKS proxy tests.
quickfix-j/quickfixj#1347
quickfix-j/quickfixj#1348
It looks like this was introduced by #77 however all combinations of tests fail with a deadlock, which also means that there is an existing problem with
org.apache.mina.filter.ssl.SSLHandlerG0implementation.Currently I was only able to confirm SSL + SOCKS proxy combination failures, but some of the failures in mentioned QuickFIXj PRs look suspicious. It will be easier to investigate if we solve this problem first.
Notes