[QFJ-339] Message grammar checks not handled correctly before Logon messages exchanged Created: 19/Aug/08  Updated: 15/Nov/12  Resolved: 05/Apr/10

Status: Closed
Project: QuickFIX/J
Component/s: Engine
Affects Version/s: 1.3.1
Fix Version/s: 1.5.0

Type: Bug Priority: Default
Reporter: aleksey ratushnyy Assignee: Unassigned
Resolution: Not a bug Votes: 1
Labels: None


 Description   

When message grammar validation fails (Invalid tag number, or similar errors) on any message before Logon messages are exchanged (including Logon message itself), Quickfix/J attempts to send Reject message which causes "Tried to send a reject while not logged on" SessionException

quickfix.SessionException: Tried to send a reject while not logged on: Invalid tag number (field 9001)
at quickfix.Session.generateReject(Session.java:1050)
at quickfix.Session.next(Session.java:733)
at quickfix.mina.SingleThreadedEventHandlingStrategy$SessionMessageEvent.processMessage(SingleThreadedEventHandlingStrategy.java:106)
at quickfix.mina.SingleThreadedEventHandlingStrategy.block(SingleThreadedEventHandlingStrategy.java:70)
at quickfix.mina.SingleThreadedEventHandlingStrategy$1.run(SingleThreadedEventHandlingStrategy.java:86)
at java.lang.Thread.run(Thread.java:595)

As the result, is a counterparty happens to send an incorrect or undefined tag inside Logon message, the response Logon is never sent, and the connection is never dropped, so the counterparty is only learns of the problem via timeout.



 Comments   
Comment by Kent Vogel [ 09/Oct/08 ]

This also happens for SendingTime accuracy problem.

Comment by Steve Bate [ 05/Apr/10 ]

The error message is accurate but not particularly helpful. I've modified it to specify that an error has occurred before logon. However, the session does disconnect when these types of errors occur. I've added two unit tests to explicitly verify this behavior. It's also tested in the acceptance tests.

Is it possible that the client FIX engine is not recognizing the dropped connection?

Comment by Kent Vogel [ 05/Apr/10 ]

The client recognizes the dropped connection. The problem is, that's all they get. There is not way for them to figure out what they did wrong without calling support on the other side and asking. For example, if someone tries to send a Logon message and forgets to include the password field, they get no error message back indicating that, just a dropped connection.

I have this problem with every new customer that first tries to integrate. They send their first Logon message, there's always some problem with it (SendingTime accuracy, missing Username, etc...), they get nothing, and generally assume it's a network problem, because they never received a single FIX message from us.

Comment by aleksey ratushnyy [ 05/Apr/10 ]

Hi, I have just tried this same scenario with QuickFix/J 1.4 and this is not true at least in our case:
Server is running QuickFix/J
Client sends a Logon message to the server with some field that does not belong to logon message
The server does not respond, and does not drop the connection.
If you look at the stack trace defined in the bug, nothing has really changed from what I can tell:
quickfix.Session.generateReject throws "Tried to send a reject while not logged on" SessionException which is caught by quickfix.mina.SingleThreadedEventHandlingStrategy$SessionMessageEvent.processMessage() which calls
LogUtil.logThrowable(quickfixSession.getSessionID(), e.getMessage(), e); and does not do anything else

How exactly does it disconnect????????

Generated at Sat Nov 23 10:47:56 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.