[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:
Relates
is related to QFJ-71 Initiator's application.onLogout() is... Closed

 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 QFJ-71, but the simple fact is that the latest released version is badly broken. Is there any option or workaround to make 1.0.3 not hang on disconnection? If not, is there a chance for a fixed release soon?

Comment by Steve Bate [ 12/Oct/06 ]

Removed the join calls on MINA close operations.

Generated at Sat Nov 23 07:29:16 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.