Kingdon1992 opened a new issue #2783:
URL: https://github.com/apache/rocketmq/issues/2783


   BUG REPORT
   
![image](https://user-images.githubusercontent.com/42442066/113693142-de483380-9700-11eb-829f-987bed085518.png)
   
   1. When `index` reaches `Integer.MAX_VALUE`,the next value of `index` will 
be `Integer.MIN_VALUE`
   2. `Math.asb(Integer.MIN_VALUE)` will be `Integer.MIN_VALUE`
   3. Then `getAndIncrement()` return value will always be `Integer.MAX_VALUE` 
or `Integer.MIN_VALUE`
   4. Considering that the initial value of index is random, it can be very 
close to `Integer.MAX_VALUE` at the beginning
   5. Although there are multiple `MessageQueue` for the target topic, only two 
`MessageQueue` will actually be selected
       - pos=0
       - pos=Math.abs(Integer.MAX_VALUE) % this.messageQueueList.size();
   
   
![image](https://user-images.githubusercontent.com/42442066/113695761-d211a580-9703-11eb-8ba5-3ad6ff6d85bf.png)
   


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to