XiaoyiPeng commented on code in PR #4350:
URL: https://github.com/apache/rocketmq/pull/4350#discussion_r878791161


##########
client/src/main/java/org/apache/rocketmq/client/latency/LatencyFaultToleranceImpl.java:
##########
@@ -76,7 +76,9 @@ public String pickOneAtLeast() {
             if (half <= 0) {
                 return tmpList.get(0).getName();
             } else {
-                final int i = this.whichItemWorst.incrementAndGet() % half;
+                int i = this.whichItemWorst.incrementAndGet() % half;
+                if (i < 0)

Review Comment:
   Well, I didn't make it clear in the context.
   
    `i` is  return from the method `ThreadLocalIndex#incrementAndGet()`, when 
variable `index` in this method reach to Integer.MAX_VALUE,  `++index`  will be 
value of `Integer.MIN_VALUE`,  its absolute value 
(`Math.abs(Integer.MIN_VALUE)`) is itself, that's a negative value.



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

To unsubscribe, e-mail: [email protected]

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

Reply via email to