Skip to content

Commit

Permalink
CURATOR-262. Fix sleepMs overflow (#490)
Browse files Browse the repository at this point in the history
Co-authored-by: shenjianeng <sjn@dxy.cn>
  • Loading branch information
shenjianeng and shenjianeng committed Dec 20, 2023
1 parent e949731 commit 111f3a6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public int getBaseSleepTimeMs() {
@Override
protected long getSleepTimeMs(int retryCount, long elapsedTimeMs) {
// copied from Hadoop's RetryPolicies.java
long sleepMs = baseSleepTimeMs * Math.max(1, random.nextInt(1 << (retryCount + 1)));
long sleepMs = (long) baseSleepTimeMs * Math.max(1, random.nextInt(1 << (retryCount + 1)));
if (sleepMs > maxSleepMs) {
log.warn(String.format("Sleep extension too large (%d). Pinning to %d", sleepMs, maxSleepMs));
sleepMs = maxSleepMs;
Expand Down

0 comments on commit 111f3a6

Please sign in to comment.