From: traggatt <tra...@ah...> - 2017-08-02 11:29:14
|
Hi Chris, Apologies for the long delay in responding here. I tested the new 1.6.4 release and the issue is still there. After a little debugging, I have a new explanation for the behaviour - please see below. When a FIX acceptor is shutdown, a call is made to SessionConnector.logoutAllSessions(). This calls Session.logout() on all sessions in turn, regardless of prior status. The logout() method is asynchronous and merely sets a private flag in Session. The actual logout message is sent later when the flag is picked up by a background thread (see Session.next()). After the SessionConnector.logout() call completes, the SessionConnector should wait for all sessions to be logged out. However, due to incorrect use of SessionConnector.isLoggedOn(), waitForLogout() is never called. isLoggedOn() performs an AND-style operation on the results of all session.isLoggedOn() methods. This means that if one or more sessions are not logged on, we do not wait for those that are. In our configuration, we run multiple sessions which are not necessarily all connected at once. Thus we do not see the shutdown routine wait for the logout message to be sent. Testing with our application, if I override the SessionConnector class and switch in an OR-style operation for the isLoggedOn() call, I always see the logout being sent. FYI: latest 1.6.x version of SessionConnector: https://github.com/quickfix-j/quickfixj/blob/QFJ_1_6_x/quickfixj-core/src/main/java/quickfix/mina/SessionConnector.java Thanks Tim. -- View this message in context: http://quickfix-j.364392.n2.nabble.com/Acceptor-dropping-logout-messages-tp7579837p7580084.html Sent from the QuickFIX/J mailing list archive at Nabble.com. |