[QFJ-394] SocketInitiator.stop(false) always waits sessions logoutTimeout before exit Created: 15/Jan/09  Updated: 03/Feb/10

Status: Open
Project: QuickFIX/J
Component/s: Engine
Affects Version/s: 1.3.3
Fix Version/s: None

Type: Bug Priority: Default
Reporter: Alexey Utkin Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: None


 Description   

SocketInitiator.stop(false) doesn't check sessions state. It always waits session logoutTimeout

It seems a bug in SessionConnection.waitForLogout()



 Comments   
Comment by Peter Franzen [ 03/Feb/10 ]

As far as I can tell, the problem lies in SessionConnection.waitForLogout().

If a session hasn't received its logout response when this method is entered
waitForLogout() keeps it in the local set of logged on sessions until the session's
logout timeout expires.

I noticed this problem when moving from 1.2.1 to 1.3.x, it seems to have been
introduced in version 1.3.

The solution would be to check if the session has been logged out each time
the sessions in the local logged on set are checked.

This could be achieved by changing the inner while loop in waitForLogout() to

while (sessionItr.hasNext()) {
Session session = sessionItr.next();
if (elapsed >= session.getLogoutTimeout() * 1000L) {
try

{ session.disconnect(); }

catch (IOException e)

{ log.error(e.getMessage(), e); }

}
if (!session.isLoggedOn())
sessionItr.remove();
}

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