mumrah commented on a change in pull request #10455:
URL: https://github.com/apache/kafka/pull/10455#discussion_r607313601



##########
File path: 
clients/src/main/java/org/apache/kafka/common/utils/ExponentialBackoff.java
##########
@@ -47,7 +47,8 @@ public long backoff(long attempts) {
         }
         double exp = Math.min(attempts, this.expMax);
         double term = initialInterval * Math.pow(multiplier, exp);
-        double randomFactor = ThreadLocalRandom.current().nextDouble(1 - 
jitter, 1 + jitter);
+        double randomFactor = jitter < Double.MIN_NORMAL ? 1.0 :

Review comment:
       I had to look this constant up :) 
   
   Can we just make it check if the jitter is equal to zero (or maybe `<=` 
zero)? A caller of this method setting jitter to something like 0.5 might be 
surprised that there is no jitter added.




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