Skip to content

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

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

wqyenjoy
Copy link

@wqyenjoy wqyenjoy commented Jul 5, 2025

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant