Skip to content

[ISSUE #10829] fix(common): handle negative version values - #10839

Open
yuluo-yx wants to merge 1 commit into
apache:developfrom
yuluo-yx:0808-yuluo/fix-1
Open

[ISSUE #10829] fix(common): handle negative version values#10839
yuluo-yx wants to merge 1 commit into
apache:developfrom
yuluo-yx:0808-yuluo/fix-1

Conversation

@yuluo-yx

@yuluo-yx yuluo-yx commented Aug 8, 2026

Copy link
Copy Markdown
Member

Which Issue(s) This PR Fixes

Brief Description

Clamp negative version values to the earliest known RocketMQ version so remote metadata cannot trigger an array index failure.

How Did You Test This Change?

  • mise x java@temurin-17 -- mvn -pl common -Dtest=MQVersionTest test

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.31%. Comparing base (fd0c959) to head (fa49f0c).

Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10839      +/-   ##
=============================================
- Coverage      48.37%   48.31%   -0.07%     
+ Complexity     13555    13534      -21     
=============================================
  Files           1380     1380              
  Lines         101165   101169       +4     
  Branches       13127    13129       +2     
=============================================
- Hits           48940    48879      -61     
- Misses         46250    46301      +51     
- Partials        5975     5989      +14     

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

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

LGTM. Good defensive validation — rejecting negative version values in RemotingCommand.decode prevents corrupted/malformed frames from being processed with invalid protocol versions. The early check before LanguageCode.valueOf is correctly placed.


Automated review by github-manager-bot

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.

MQVersion throws ArrayIndexOutOfBoundsException for negative version values

3 participants