protected void backoffForAttempt(int retryAttempt, String message) { backoffLimitedRetryHandler.imposeBackoffExponentialDelay(retryAttempt, message); }
public void imposeBackoffExponentialDelay(int failureCount, String commandDescription) { imposeBackoffExponentialDelay(delayStart, 2, failureCount, retryCountLimit, commandDescription); }
public void imposeBackoffExponentialDelay(long period, long maxPeriod, int pow, int failureCount, int max, String commandDescription) { long delayMs = (long) (period * Math.pow(failureCount, pow)); delayMs = (delayMs > maxPeriod) ? maxPeriod : delayMs; if (LOG.isDebugEnabled()) LOG.debug("Retry {}/{}: delaying for {} ms: {}", new Object[] {failureCount, max, delayMs, commandDescription}); try { Thread.sleep(delayMs); } catch (InterruptedException e) { Exceptions.propagate(e); } }