Skip to content

[ISSUE #10874] fix(common): compare message queue ids safely - #10884

Merged
fuyou001 merged 1 commit into
apache:developfrom
yuluo-yx:0809-yuluo-yx/fix-5
Aug 10, 2026
Merged

[ISSUE #10874] fix(common): compare message queue ids safely#10884
fuyou001 merged 1 commit into
apache:developfrom
yuluo-yx:0809-yuluo-yx/fix-5

Conversation

@yuluo-yx

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

Copy link
Copy Markdown
Member

Which Issue(s) This PR Fixes

Brief Description

MessageQueue.compareTo now uses Integer.compare for queue IDs, preventing subtraction overflow from reversing the ordering of extreme values. Regression tests cover both directions and equality.

How Did You Test This Change?

  • mise exec java@zulu-8.94.0.17 -- mvn -pl common -DskipITs -Dtest=MessageQueueTest test (2 tests passed)
  • Checkstyle and SpotBugs passed in the same Maven reactor.
  • git diff --check and the 400-line scope gate passed.
  • Not run: full repository build, container tests, or end-to-end tests.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10884      +/-   ##
=============================================
- Coverage      48.39%   48.32%   -0.08%     
+ Complexity     13562    13537      -25     
=============================================
  Files           1380     1380              
  Lines         101165   101165              
  Branches       13127    13127              
=============================================
- Hits           48962    48886      -76     
- Misses         46233    46290      +57     
- Partials        5970     5989      +19     

☔ 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. Trivial change, looks good.


Automated review by github-manager-bot

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

@fuyou001
fuyou001 merged commit e345861 into apache:develop Aug 10, 2026
10 checks passed
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] MessageQueue.compareTo overflows for extreme queue IDs

4 participants