You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/04/05 20:59:11 UTC
[GitHub] [kafka] cmccabe commented on a change in pull request #10455: MINOR: Support ExponentialBackoff without jitter
cmccabe commented on a change in pull request #10455:
URL: https://github.com/apache/kafka/pull/10455#discussion_r607330220
##########
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:
`MIN_NORMAL` is 2^-1022, though. So it certainly wouldn't affect someone setting jitter = 0.5.
--
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:
users@infra.apache.org