Do not increment NextTargetMsgSeqNum for out of sequence Logout and Test Requests #645
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If an out-of-sequence Logout or Test Request is received, either during
inSession
orresendState
, it should not result in incrementing the next expected target sequence number, or else we have a chance of missing a message.Consider the scenario below from the point of view of an Initiator.
We receive a Logout request from Acceptor:
After some time we try to Logon again:
But we receive another Logout request from Acceptor:
However, this out-of-sequence Logout request received from the Acceptor increments the next expected target sequence number from 101 to 102. Hence, when we try to Logon again:
Therefore, we have now permanently skipped asking for a resend of sequence number 101, even though we never received it. This will result in us missing sequence number 101 from the Acceptor.
This PR addresses this issue for out-of-sequence Logout Requests as well as for Test Requests which seem to have the same problem.