[QFJ-673] QFJ sequence problem following inbound SequenceReset - a previously received ResendRequest not "queued"? Created: 30/Mar/12 Updated: 16/Jul/18 Resolved: 18/Dec/13 |
|
Status: | Closed |
Project: | QuickFIX/J |
Component/s: | Engine |
Affects Version/s: | 1.5.0 |
Fix Version/s: | 1.6.0 |
Type: | Bug | Priority: | Default |
Reporter: | John Peng | Assignee: | Christoph John |
Resolution: | Fixed | Votes: | 2 |
Labels: | Reconnect, ResendRequest,, SequnceReset,, queued, sequence, |
Attachments: | QFJ_bug_report.log | ||||||||||||||||
Issue Links: |
|
Description |
Sequence of events - from the perspective of an Acceptor: 0. Acceptor is restarted with inbound sequence number reset to 0 - all missed messages were session messages. This problem seems to be due to that QFJ failed to "queue" the received ResendRequest at step 3 above, and hence treated sequence 7 as never received. Log excerpt below: |
Comments |
Comment by John Peng [ 30/Mar/12 ] |
Log excerpt attached as file. |
Comment by John Peng [ 30/Mar/12 ] |
After doing a quick trace-through into the 1.6 code – I now have a better idea as to why this was happening: 1. Session.State.enqueue() is only called via Session.doTargetTooHigh(); Therefore, a ResendRequest that comes after an outstanding sequence gap is NEVER enqueued! I believe the following code in Session.java should be improved in order to fix the bug: .......... In particular, verify() shouldn't always be called with "false, false". More conditional check on the Session state should be carried out to determine the right value for the parameters. |
Comment by John Peng [ 30/Mar/12 ] |
Given the above, this issue would affect version 1.6 as well. Can someone help modify "Affects Version/s" to also include 1.6? Thanks. |
Comment by Heribert Steuer [ 13/Dec/13 ] |
Being still an open bug, can someone confirm that Johns patch addresses this problem correctly? Its pretty annoying as we have a couple of FIX sessions using VPN, broken network connections regularily bring up this problems and |
Comment by Christoph John [ 13/Dec/13 ] |
Calling verify with "true", "true" is likely to correct the problem and will adhere to the spec (see |
Comment by Christoph John [ 16/Dec/13 ] |
There are two problems here: Problem 2 can be corrected by changing method Session.nextQueued(int num) to also process queued ResendRequests and not just increment the target seqnum. Proposed fix is: |
Comment by Christoph John [ 18/Dec/13 ] |
Committed as rev1127: http://sourceforge.net/p/quickfixj/code/1127/ Just enabling the "tooHigh"-check in verify() would have solved the original problem. However, this could have lead to kind of a deadlock in which the counterparty waited for our messages to be resent and we were also waiting for our ResendRequest to be satisfied in order to process the queued ResendRequest of the counterparty (and only then send the missing messages to the counterparty). |