-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix off-by-one in RetryingChannel, use the configured number of retries #367
Conversation
Generate changelog in
|
// TODO(dfox): include retry number in the request somehow | ||
return delegate.execute(endpoint, request); | ||
}; | ||
FutureCallback<Response> retryer = new RetryingCallback(callSupplier, future); | ||
Futures.addCallback(callSupplier.apply(0), retryer, DIRECT_EXECUTOR); | ||
|
||
DialogueFutures.addDirectCallback(callSupplier.apply(0), retryer); | ||
return future; | ||
} | ||
|
||
private final class RetryingCallback implements FutureCallback<Response> { | ||
private final AtomicInteger failures = new AtomicInteger(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be an int
given that retries are sequenced we can rely on the happens-before relationship.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you want to make that change as part of this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add it to a an improvement on top of this PR, might be best if you'd like to review that in isolation :-]
👍 |
==COMMIT_MSG==
Fix off-by-one in RetryingChannel, use the configured number of retries
==COMMIT_MSG==
Possible downsides?
Doesn't support the configured backoff interval yet.