Skip to content

[ISSUE-9500] Fix transaction message check service offset advancement… - #9523

Closed
typefield wants to merge 1 commit into
apache:developfrom
typefield:develop
Closed

[ISSUE-9500] Fix transaction message check service offset advancement…#9523
typefield wants to merge 1 commit into
apache:developfrom
typefield:develop

Conversation

@typefield

Copy link
Copy Markdown

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”.

  • 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 [Bug] Push forward the half and op queue offset should be in finally block #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.

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?

… 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.
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

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.

@github-actions github-actions Bot added the stale label Jul 8, 2026
@github-actions

Copy link
Copy Markdown

This PR was closed because it has been inactive for 3 days since being marked as stale.

@github-actions github-actions Bot closed this Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant