[QFJ-342] Add text reason to forced logouts/disconnects Created: 22/Aug/08  Updated: 15/Nov/12  Resolved: 05/Apr/10

Status: Closed
Project: QuickFIX/J
Component/s: None
Affects Version/s: 1.3.2
Fix Version/s: 1.4.0

Type: Improvement Priority: Default
Reporter: Toli Kuznets Assignee: Toli Kuznets
Resolution: Fixed Votes: 0
Labels: None


 Description   

This is in reference to http://n2.nabble.com/Banzai-example-question--tt364931.html#a364932 thread

If the sender has SendingTime accuracy issues, QFJ just disconnects the session but the sender doesn't see any detailed "reasons" for why that happens.

Would be nice to see a reason for a sending time accuracy disconnect, along with others such as "multiple connections from same senderCompID".



 Comments   
Comment by Toli Kuznets [ 22/Aug/08 ]

So this turns out to be a little less straightforward and easy to fix than i hoped.
For SendingTime Accuracy problems, the workflow is this (demonstrated by putting a breakpoint in Session.doBadTime or Session.generateReject

Login comes in for a new session
bad time (sending time sync problem) is detected and generateReject is called
since we never received a valid logon for this session, generateReject throws an exception and as a result we never send the reject or logout (which could have the text message)

The connecting session is simply dropped (disconnected) - with no logouts sent.
All you see on the client side is a session disconnect

Not sure what the best way to approach this problem is. Ideally, we'd just catch the exception and send a logout (or always send a reject even if it's not logged on).

Or maybe catch the exception in Session.doBadTime(), send a logout (with error messages as logout text) and rethrow the exception to force a disconnect?
I've modified the code and acceptance tests to check for that, and it seems to work.

Steve, what are your thoughts?

Comment by Toli Kuznets [ 23/Aug/08 ]

I also wanted to send out a useful reject message for the case when you have multiple connections for the same session.
The current behaviour is to just close the session when multiple connections are detected - see AbstractIoHandler.processMessage().

I'd imagine the right behaviour is to keep existing session, and to send a reject/logout message to the 2nd connection

Fixing this is a bit more non-trivial - it'll require some fairly invasive changes to allow certain methods in Session to be public if we wanted to reuse code.
What's the right behaviour? Create a new "logout" session that only sends a logout/reject out, and then close it immediately?
What would be the best way to implement that?

Comment by Toli Kuznets [ 01/Oct/08 ]

Sending a text reason for forced logout/disconnect added in rev 870 .

Still need to figure out the best way to approach sending a rejection message on disconnect when you have multiple simultaneous connection attempts.

Comment by Toli Kuznets [ 01/Oct/08 ]

wrong link to the rev above. the right rev is here

Comment by Toli Kuznets [ 12/Nov/08 ]

I've created a tag for the QFJ-342 fix that deals with notifying on "multiple connections from same senderCompID" case.

http://quickfixj.svn.sourceforge.net/viewvc/quickfixj/branches/qfj-342/core/

The fix works fine with Executor/Banzai examples. I've written an acceptance test for it which passes as well, but somehow my fix really messes up some of the subsequent acceptance tests. And I'm not sure if it's due to the way acceptance tests are setup, or if there's a lingering error or a false assumption in the way that i have fixed code to send a reject.

I removed all acceptance tests but 2 in the branch - one that exercises QFJ-342, and another that fails subsequently. If you remove the 1b_DuplicateIdentity.def test then all the others pass as well

Not sure where to go from here - would like to speak with someone that knows more about the acceptance test suite to see what may be going on.

Acceptance tests
AcceptorIOHandler change

Comment by Steve Bate [ 05/Apr/10 ]

Resolved based on Toli's comments.

Generated at Sat Nov 23 13:55:37 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.