jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Phillips <notificati...@github.com>
Subject Re: [jclouds] JCLOUDS-460: Add jitter to avoid thundering herd (#286)
Date Tue, 11 Feb 2014 15:52:23 GMT
> @@ -126,6 +127,9 @@ public void imposeBackoffExponentialDelay(long period, int pow, int
failureCount
>     public void imposeBackoffExponentialDelay(long period, long maxPeriod, int pow, int
failureCount, int max,
>              String commandDescription) {
>        long delayMs = (long) (period * Math.pow(failureCount, pow));
> +      // Add random delay to avoid thundering herd problem when multiple
> +      // simultaneous failed requests retry after sleeping for the same delay.
> +      delayMs += new Random().nextInt((int) (delayMs / 10));

This will be very small if delayMs happens to be small. Is that intentional?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/286/files#r9628689
Mime
View raw message