The GitHub Actions job "Build and Run Tests by Maven" on 
rocketmq.git/fix/long-comparator-overflow-10674 has failed.
Run started by GitHub user dong0713 (triggered by dong0713).

Head commit for run:
36caac608838b0f5aedbebf3056b6343bc679f00 / dong0713 <[email protected]>
[ISSUE #10674] Fix integer overflow in three long-to-int comparators

PR #10579 fixed a long-to-int subtraction overflow in DefaultElectPolicy.
A systematic scan found three more comparators with the same pattern:
long fields cast to int via (int)(a - b), overflowing when the delta
exceeds Integer.MAX_VALUE.

1. PopRequest.COMPARATOR (broker, long-polling): expired timestamp and
   op counter (starts at Long.MIN_VALUE -> overflow essentially guaranteed).
   Backs a ConcurrentSkipListSet; broken ordering corrupts the set invariants.
2. PopCheckPoint.compareTo (store): startOffset long queue offset.
3. PopReviveService.genSortList (broker): reviveOffset long commit-log offset.

Fix all three to use Long.compare, mirroring the #10579 fix.
Add regression tests covering deltas beyond Integer.MAX_VALUE.

Report URL: https://github.com/apache/rocketmq/actions/runs/30420226973

With regards,
GitHub Actions via GitBox

Reply via email to