Skip to content

[ISSUE #10943] Tolerate incomplete queue-offset metadata during message decoding - #10944

Open
Aias00 wants to merge 2 commits into
apache:developfrom
Aias00:fix/escape-bridge-missing-queue-offset
Open

[ISSUE #10943] Tolerate incomplete queue-offset metadata during message decoding#10944
Aias00 wants to merge 2 commits into
apache:developfrom
Aias00:fix/escape-bridge-missing-queue-offset

Conversation

@Aias00

@Aias00 Aias00 commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Makes message decoding tolerate valid message buffers when the corresponding queue-offset metadata is absent or shorter than the buffer list.

The fix covers both EscapeBridge and PopReviveService. Each applies a consume-queue offset only when one is available, otherwise retaining the decoded message.

Test

mvn -pl broker -Dtest=EscapeBridgeTest#decodeMsgListTest_messageOffsetMissing,PopReviveServiceTest#testDecodeMsgListWithoutQueueOffsets test

Closes #10943.

Aias00 added 2 commits August 15, 2026 08:11
Signed-off-by: liuhy <liuhongyu@apache.org>
Signed-off-by: liuhy <liuhongyu@apache.org>
@Aias00 Aias00 changed the title [ISSUE #10943] Tolerate incomplete EscapeBridge queue-offset metadata [ISSUE #10943] Tolerate incomplete queue-offset metadata during message decoding Aug 15, 2026

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Good defensive fix for handling incomplete queue-offset metadata during message decoding.

The change adds null and bounds checks before accessing getMessageQueueOffset().get(i), preventing IndexOutOfBoundsException when the offset list is shorter than the message buffer list. This can happen with partial or corrupted metadata.

The fix is applied consistently in both EscapeBridge.decodeMsgList() and PopReviveService.decodeMsgList(), and only overrides the queue offset when the store actually supplied one, preserving the decoded offset otherwise.

Test coverage validates the fix with a scenario where the offset list is intentionally shorter than the message list.

LGTM.


Automated review by github-manager-bot

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.51%. Comparing base (293f588) to head (e79b65e).

Files with missing lines Patch % Lines
...he/rocketmq/broker/processor/PopReviveService.java 33.33% 1 Missing and 1 partial ⚠️
.../apache/rocketmq/broker/failover/EscapeBridge.java 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10944      +/-   ##
=============================================
- Coverage      48.62%   48.51%   -0.11%     
+ Complexity     13692    13655      -37     
=============================================
  Files           1381     1381              
  Lines         101464   101468       +4     
  Branches       13187    13189       +2     
=============================================
- Hits           49337    49231     -106     
- Misses         46142    46223      +81     
- Partials        5985     6014      +29     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

[Bug] EscapeBridge fails to decode messages when queue-offset metadata is incomplete

3 participants