private void handleRetry(Object cause) { context.retryCount.inc(); if (invokeCount % LOG_INVOCATION_COUNT_MOD == 0) { Level level = invokeCount > LOG_MAX_INVOCATION_COUNT ? WARNING : FINEST; if (context.logger.isLoggable(level)) { context.logger.log(level, "Retrying invocation: " + toString() + ", Reason: " + cause); } } if (future.interrupted) { complete(INTERRUPTED); } else { try { InvocationRetryTask retryTask = new InvocationRetryTask(); if (invokeCount < MAX_FAST_INVOCATION_COUNT) { // fast retry for the first few invocations context.invocationMonitor.execute(retryTask); } else { // progressive retry delay long delayMillis = Math.min(1 << (invokeCount - MAX_FAST_INVOCATION_COUNT), tryPauseMillis); context.invocationMonitor.schedule(retryTask, delayMillis); } } catch (RejectedExecutionException e) { completeWhenRetryRejected(e); } } }
private void handleRetry(Object cause) { context.retryCount.inc(); if (invokeCount % LOG_INVOCATION_COUNT_MOD == 0) { Level level = invokeCount > LOG_MAX_INVOCATION_COUNT ? WARNING : FINEST; if (context.logger.isLoggable(level)) { context.logger.log(level, "Retrying invocation: " + toString() + ", Reason: " + cause); } } if (future.interrupted) { complete(INTERRUPTED); } else { try { InvocationRetryTask retryTask = new InvocationRetryTask(); if (invokeCount < MAX_FAST_INVOCATION_COUNT) { // fast retry for the first few invocations context.invocationMonitor.execute(retryTask); } else { // progressive retry delay long delayMillis = Math.min(1 << (invokeCount - MAX_FAST_INVOCATION_COUNT), tryPauseMillis); context.invocationMonitor.schedule(retryTask, delayMillis); } } catch (RejectedExecutionException e) { completeWhenRetryRejected(e); } } }