Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resend range variables are not reset if the resend request is rejected #888

Open
vishwajit2 opened this issue Oct 3, 2024 · 3 comments
Open

Comments

@vishwajit2
Copy link

Describe the bug
Upon detecting the sequence number higher than the expected, the FIX client sends a resend request. But few vendors reject the resend requests in scenarios when those resend requests could not be fulfilled. They also provide with the starting sequence number from which we can request in the reject message. QuickFix session layer should handle this and reset the resend range that was set back to intitial state as there is no active state.

But currently resend range ia not reset, this makes Quickfix think that there is an active resend request. Hence it does not attempt to send the resend request next time a message with higher sequence number is received.

The issue that I am facing because of this:
I intent to handle reject message in fromAdmin and modify the next expected target sequence number to the starting sequence number that we got in reject message. So the next time QuickFix session layer sends the resend request, it uses current start sequence number. But with current implementation resend request is not sent at all.

To Reproduce
Send a message with sequence number higher than expected. Client will send the resend request. Send the reject message in response to the Resend Request and continue sending the messages with higher sequence numbers.

Expected behavior
Quickfix should detect that Rejeci message is in reference to the Resend request and resend range should be reset back to initial state. As resend range is private variable of session without any setters. This should be handled within Session class.

system information:

  • QFJ Version [e.g. 2.3.1]
@vishwajit2 vishwajit2 added the bug label Oct 3, 2024
@chrjohn
Copy link
Member

chrjohn commented Oct 3, 2024

How can a resend request be rejected? Does not sound like standard FIX to me.
Since this does not seem standard maybe we could provide some means that users could reset the resend state. But need to think about it.
Do you have an example message flow from your logs?

@chrjohn chrjohn added enhancement and removed bug labels Oct 3, 2024
@vishwajit2
Copy link
Author

I can not share the exact logs here but can describe rhe message flow in detail.

  1. Client sends Logon to the server. Server sends back the logon response with 34 = 14000. Client had the next expected sender number as 1.
  2. Client sends the resend request from 1 to 4000 (4000 is the chunk size here). But Server can only resend the messages from 7001. So it sends a session level reject (MsgType : 3)with a field that contains the sequence number from which messages can be resent (i.e. resend request can be processed).
  3. Client handles this in fromAdmin by modifying session's next expected target number to 7001.
  4. Client receives a business message from server with sequence number 14001. Client does not send resend request saying "Resend request from 1 to 4000 already in progress, not sending another" and the curri message is added to the queue.

A work around we are thinking of is disconnecting the session (which will reset the resend range) and connecting back again. But this is not a good solution and some feature from the quick fix to achieve this would be appreciated.

@chrjohn
Copy link
Member

chrjohn commented Oct 5, 2024

Exact logs are not needed, but the session messages from your points 1-4 would be helpful. You can replace the comp ids with dummy values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants