-
Notifications
You must be signed in to change notification settings - Fork 658
Fix incorrect resend of session-level messages with ForceResendWhenCorruptedStore
#1124
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
base: master
Are you sure you want to change the base?
Conversation
…tore is enabled - Modified Session.resendMessages() to remove dependency on forceResendWhenCorruptedStore flag for admin message detection - Added special handling for Reject messages (MsgType=3) - only Reject messages among admin messages are now resent - Other session-level messages (Logon, Logout, Heartbeat, etc.) are properly skipped with SequenceReset GapFill - Handle corrupted store by adding null placeholders instead of fake Heartbeat messages - Added comprehensive test to verify the fix - Added setter for forceResendWhenCorruptedStore in SessionFactoryTestSupport.Builder Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
ForceResendWhenCorruptedStore
| LOG.error("Cannot read messages from stores, will gap fill over missing messages", e); | ||
| // Add null placeholders for corrupted messages instead of fake Heartbeats | ||
| for (int i = beginSeqNo; i < endSeqNo; i++) { | ||
| final Message heartbeat = messageFactory.create(sessionID.getBeginString(), | ||
| MsgType.HEARTBEAT); | ||
| initializeHeader(heartbeat.getHeader()); | ||
| heartbeat.getHeader().setInt(MsgSeqNum.FIELD, i); | ||
| messages.add(heartbeat.toString()); | ||
| messages.add(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot please roll back these changes and restore the former logic that puts Heartbeats into the messages list.
Moreover, use the session-specific log instead of the global LOG.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in e180fa4. Restored the original logic that creates Heartbeat messages and changed to use getLog().onErrorEvent() for session-specific logging.
| // Handle null placeholders from corrupted store | ||
| if (message == null) { | ||
| // Mark for gap fill | ||
| if (begin == 0) { | ||
| begin = current; | ||
| } | ||
| current++; | ||
| continue; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot this can be removed also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in e180fa4. Removed the null placeholder handling code.
…ific log - Restored original corrupted store handling that creates Heartbeat messages instead of null placeholders - Changed LOG.error to getLog().onErrorEvent to use session-specific logging - Removed null placeholder handling code - Kept the core fix for admin message resend logic (Reject messages handling) Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Fix: Prevent incorrect resend of session-level messages when ForceResendWhenCorruptedStore is enabled
Progress:
resendMessages()in Session.java to:forceResendWhenCorruptedStoreflag for admin message detectionSummary
✅ Core fix for admin message handling maintained
✅ Original Heartbeat logic for corrupted store restored
✅ Session-specific logging used throughout
✅ All session tests pass (72/72)
Original prompt
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.