You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "wqyenjoy (via GitHub)" <gi...@apache.org> on 2025/07/05 15:31:19 UTC

[PR] [ISSUE-9500] Fix transaction message check service offset advancement… [rocketmq]

wqyenjoy opened a new pull request, #9523:
URL: https://github.com/apache/rocketmq/pull/9523

   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 #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!
   
   <!-- Please make sure the target branch is right. In most case, the target branch should be `develop`. -->
   
   ### Which Issue(s) This PR Fixes
   
   <!-- Please ensure that the related issue has already been created, and [link this pull request to that issue using keywords](<https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword>) to ensure automatic closure. -->
   
   Fixes #issue_id
   
   ### Brief Description
   
   <!-- Write a brief description for your pull request to help the maintainer understand the reasons behind your changes. -->
   
   ### How Did You Test This Change?
   
   <!-- In order to ensure the code quality of Apache RocketMQ, we expect every pull request to have undergone thorough testing. -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ISSUE-9500] Fix transaction message check service offset advancement… [rocketmq]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9523:
URL: https://github.com/apache/rocketmq/pull/9523#issuecomment-4910262093

   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 is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ISSUE-9500] Fix transaction message check service offset advancement… [rocketmq]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9523:
URL: https://github.com/apache/rocketmq/pull/9523#issuecomment-4949315210

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ISSUE-9500] Fix transaction message check service offset advancement… [rocketmq]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #9523: [ISSUE-9500] Fix transaction message check service offset advancement…
URL: https://github.com/apache/rocketmq/pull/9523


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org