-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
Migration to reactor.util.retry.Retry after old retry deprecation (#1125) #1128
Migration to reactor.util.retry.Retry after old retry deprecation (#1125) #1128
Conversation
…rface deprecation (Discord4J#1125)
.doBeforeRetry(retrySignal -> { | ||
if (log.isDebugEnabled()) { | ||
log.debug("Retry {} in bucket {} due to {}", | ||
retrySignal.totalRetries(), | ||
id.toString(), | ||
retrySignal.failure().toString()); | ||
} | ||
}); |
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 had to remove the "for XXX seconds" indication here as the retrySignal doesn't provide any information about current ellapsed time. I did not find any workaround, as a first step I tried to compute the current duration but because we have a jitter it's random.
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 understand and it's fine. We could replicate it by creating a custom RetrySignal that contains the backoff value like in GatewayRetrySpec but it would be overkill for just a debug log line detail.
There's also a behavior change here to consider: 10 max attempts. Is that intentional? I agree with that too btw.
Noting the current API and behavior changes for 3.2.x branch in a separate commit/PR
|
Description: I tried to migrate from the old reactor Retry<?> interface to the abstract class reactor.util.retry.Retry and its two subclasses RetrySpec and RetryBackoffSpec.
I tried to refactor only, but it seems we have 2 functionnal changes that I'm going to describe in review below for feedback.
Justification: This PR fixes the issue #1125