[QFJ-82] Reconnection not working in 1.0.3 because of blocking .join() within exception callback Created: 05/Oct/06 Updated: 12/Oct/06 Resolved: 12/Oct/06 |
|
Status: | Closed |
Project: | QuickFIX/J |
Component/s: | Engine, Networking |
Affects Version/s: | 1.0.3 |
Fix Version/s: | 1.0.4 |
Type: | Bug | Priority: | Critical |
Reporter: | Andrzej Hajderek | Assignee: | Steve Bate |
Resolution: | Fixed | Votes: | 0 |
Labels: | None |
Issue Links: |
|
Description |
The exceptionCaught() callback in quickfix.mina.AbstractIoHandler calls quickFixSession.disconnect() which is now a 'blocking call' (changed from non-blocking to blocking in 1.0.3). As result, when a correctly operating connection breaks, the callback invokes the blocking quickFixSession.disconnect() and hangs indefinitely in quickfix.mina.IoSessionResponder.disconnect() on ioSession.close().join() (because the close operation cannot be completed). It is not a good idea to mix asynchronous callbacks with blocking API calls. The reconnection mechanism is broken now, which isn't good. Especially when your application is waiting for trades worth millions of dollars and it experiences a temporary network related problem. |
Comments |
Comment by Steve Bate [ 05/Oct/06 ] |
There's nothing inherently wrong with mixing the calls. The problem in this specific case is that the thread doing to the close (in the case of an exception) is the same thread doing the join call. In other situations this would work. As noted in the related issue, the problem is also related to the threading model we are using in QFJ which is intended to minimize threads and was also needed to work around a MINA bug. The bug in MINA is fixed now but rather than modifying the thread pool model, I've chosen to remove the join calls in 1.1.0. See the related issue for more details. |
Comment by Andrzej Hajderek [ 05/Oct/06 ] |
Well, some kind of academic style discussion could start here, also following the discussion related to |
Comment by Steve Bate [ 12/Oct/06 ] |
Removed the join calls on MINA close operations. |