[QFJ-570] Inappropriate sequence resync Created: 16/Dec/10  Updated: 20/May/11  Resolved: 20/May/11

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

Type: Bug Priority: Default
Reporter: Olivier Lourdais Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Environment:

quickfixj-1.5.0


Issue Links:
Relates
is related to QFJ-589 Remove the Quickfix/J forceResync set... Closed

 Description   

Initial state on client side (not synchronized with server side state, because of some other bugs):

  • NextTargetMsgSeqNum=637
  • NextSenderMsgSeqNum=500544

Reception of a TradingSessionStatus message:
8=FIX.4.4|9=220|35=h|34=571|43=N|49=056001|50=1|52=20101216-07:48:45.775|56=7|57=7|97=N|335=154729|336=20101216|340=2|341=20101216-00:30:00.000|342=20101216-01:00:00.000|344=20101216-04:30:00.000|345=20101216-05:00:00.000|625=1|10=032|

The MsgSeqNum=571 causes a sequence resync:
20101216-07:48:43: Forcing sequence resync, expected target num = 637, received = 571

The Session.forceStoreResync(Message msg) does this:

  • nextTargetMsgSeqNum = 571
    -> ok
  • nextSenderMsgSeqNum = nextTargetMsgSeqNum (because NextExpectedMsgSeqNum field is not set) = 571
    -> NOK The sender MsgSeqNum should not be modified!!!

Just after that, a Heartbeat message is sent:
8=FIX.4.4|9=70|35=0|34=571|49=OSK07|50=OSK07|52=20101216-07:49:13.947|56=056001|57=1|10=154|
With MsgSeqNum=571 instead of 500544, causing a Logout by the server!



 Comments   
Comment by Olivier Lourdais [ 16/Dec/10 ]

I think the fix is quite easy:
In Session.forceStoreResync(Message msg) method, replace

final int nextSenderMsgSeqNum = msg.isSetField(NextExpectedMsgSeqNum.FIELD) ? msg
.getInt(NextExpectedMsgSeqNum.FIELD) : nextTargetMsgSeqNum;

with

final int nextSenderMsgSeqNum = msg.isSetField(NextExpectedMsgSeqNum.FIELD) ? msg
.getInt(NextExpectedMsgSeqNum.FIELD) : state.getMessageStore().getNextSenderMsgSeqNum();

Comment by Steve Bate [ 03/May/11 ]

Eric, does this issue go away since forceResync is being removed?

Comment by Eric Deshayes [ 03/May/11 ]

Yes, it will.
It will be closed with QFJ-589.

Generated at Sat Apr 27 23:07:41 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.