[ISSUE-9500] Fix transaction message check service offset advancement… - #9523
Closed
typefield wants to merge 1 commit into
Closed
[ISSUE-9500] Fix transaction message check service offset advancement…#9523typefield wants to merge 1 commit into
typefield wants to merge 1 commit into
Conversation
… on exception - Add try-catch-finally structure in check() method to ensure offset advancement even when exceptions occur - Move offset update logic to finally block to prevent infinite loop - Add comprehensive unit tests for exception, normal, and empty queue scenarios - Fix Issue apache#9500: transaction message check service offset not advancing on exception This prevents the infinite loop where the same half message gets checked repeatedly due to offset not advancing when exceptions occur during transaction check.
|
This PR is stale because it has been open for 365 days with no activity. It will be closed in 3 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this PR. |
|
This PR was closed because it has been inactive for 3 days since being marked as stale. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Background
Transactional message checks in TransactionalMessageServiceImpl.check() occasionally threw uncaught exceptions.
When that happened, the broker did not advance the consume offsets of the half (RMQ_SYS_TRANS_HALF_TOPIC) and op (RMQ_SYS_TRANS_OP_HALF_TOPIC) queues.
As a result, the same half message was pulled and re-checked indefinitely, causing:
High broker CPU usage
Repeated WARN logs for the identical message
Potential message-check backlog growth (visible in monitoring)
The behaviour was reported in Issue #9500 as an “infinite loop while checking transactional messages”.
This prevents the infinite loop where the same half message gets checked repeatedly due to offset not advancing when exceptions occur during transaction check.
Checklist
Fixes Issue #9500
Unit tests added/updated
No breaking API changes
Logged enough context for future debugging
Please review, thanks!
Which Issue(s) This PR Fixes
Fixes #issue_id
Brief Description
How Did You Test This Change?