[QFJ-721] non-FIXT sessions: NPE accessing ApplVerID if previous Logon was not completely processed Created: 29/Nov/12  Updated: 30/Nov/12  Resolved: 30/Nov/12

Status: Resolved
Project: QuickFIX/J
Component/s: Engine
Affects Version/s: 1.5.2
Fix Version/s: 1.5.3

Type: Bug Priority: Major
Reporter: Jörg Thönnes Assignee: Christoph John
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
is related to QFJ-592 (FIXT .1.1) Application version id ca... Resolved

 Description   

In some cases the thread processing incoming FIX messages can get a NullPointerException accessing the ApplVerID
if the Logon process is not complete, e.g. because the counter party did not answer with a Logon response but continues
to send application messages.

In real ife, this issue was observed as a counter party sent many FIX messages without noticing a FIX re-login:

  1. counter party sends many messages
  2. QF/J sends logout
  3. counter party continues to send many messages
  4. QF/J forces disconnect due to Logout time-out (no 35=5 received so far)
  5. process restarts
  6. QF/J creates a new session
  7. QF/J sends Logon
  8. counter party continues to send many messages (but no Logon)
  9. QF/J receives a NPE for every message from the counter party:
    [2012-11-08 14:44:26,644] [QFJ Timer] FIX.4.4:XXXAT->XXXFL:TEST-XXX-XXXFL-YYY: outgoing: 8=FIX.4.4|9=68|35=A|34=1079|49=XXXAT|52=20121108-13:44:26.640|56=XXXFL|98=0|108=30|10=124|
    [2012-11-08 14:44:26,699] [SocketConnectorIoProcessor-0.0] FIX.4.4:XXXAT->XXXFL:TEST-XXX-XXXFL-YYY: incoming: 8=FIX.4.4|9=375|35=8|34=65834|43=Y|49=XXXFL|50=BU/XXXFL|52=20121108-13:44:26.675|56=XXXAT|122=20121108-12:45:47|6=0|...
    [2012-11-08 14:44:26,712] [QFJ Timer] FIX.4.4:XXXAT->XXXFL:TEST-XXX-XXXFL-YYY: event   : Initiated logon request
    [2012-11-08 14:44:26,801] [QFJ Message Processor] FIX.4.4:XXXAT->XXXFL:TEST-XXX-XXXFL-YYY: event   : null
    java.lang.NullPointerException
            at quickfix.MessageUtils.toBeginString(MessageUtils.java:256)
            at quickfix.DefaultDataDictionaryProvider.getApplicationDataDictionary(DefaultDataDictionaryProvider.java:62)
            at quickfix.Session.next(Session.java:913)
            at quickfix.mina.SingleThreadedEventHandlingStrategy$SessionMessageEvent.processMessage(SingleThreadedEventHandlingStrategy.java:114)
            at quickfix.mina.SingleThreadedEventHandlingStrategy.block(SingleThreadedEventHandlingStrategy.java:77)
            at quickfix.mina.SingleThreadedEventHandlingStrategy$1.run(SingleThreadedEventHandlingStrategy.java:94)
            at java.lang.Thread.run(Thread.java:722)
    [2012-11-08 14:44:26,802] [SocketConnectorIoProcessor-0.0] FIX.4.4:XXXAT->XXXFL:TEST-XXX-XXXFL-YYY: incoming: 8=FIX.4.4|9=353|35=8|34=65835|43=Y|49=XXXFL|50=BU/XXXFL|52=20121108-13:44:26.676|56=XXXAT|122=20121108-12:45:47|6=0|...
    [2012-11-08 14:44:26,811] [QFJ Message Processor] FIX.4.4:XXXAT->XXXFL:TEST-XXX-XXXFL-YYY: event   : null
    java.lang.NullPointerException
            at quickfix.MessageUtils.toBeginString(MessageUtils.java:256)
            at quickfix.DefaultDataDictionaryProvider.getApplicationDataDictionary(DefaultDataDictionaryProvider.java:62)
            at quickfix.Session.next(Session.java:913)
            at quickfix.mina.SingleThreadedEventHandlingStrategy$SessionMessageEvent.processMessage(SingleThreadedEventHandlingStrategy.java:114)
            at quickfix.mina.SingleThreadedEventHandlingStrategy.block(SingleThreadedEventHandlingStrategy.java:77)
            at quickfix.mina.SingleThreadedEventHandlingStrategy$1.run(SingleThreadedEventHandlingStrategy.java:94)
            at java.lang.Thread.run(Thread.java:722)
    


 Comments   
Comment by Jörg Thönnes [ 29/Nov/12 ]

This issue is most probably related.

Comment by Jörg Thönnes [ 29/Nov/12 ]

For non-FIXT.1.1 session this is not a race condition.

Comment by Christoph John [ 30/Nov/12 ]

The code change will be to set the targetDefaultApplVerID already on construction of the Session. Until now it was only set when a Logon message has been processed. This is OK for FIXT-sessions but for non-FIXT sessions the targetDefaultApplVerID needs not to be set on every Logon since it can be constructed from the BeginString of the SessionID.

Generated at Sat Nov 23 08:48:14 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.