Skip to content
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

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

Gregory-Widmer
Copy link
Contributor

@Gregory-Widmer Gregory-Widmer commented Apr 6, 2023

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

Comment on lines +91 to +98
.doBeforeRetry(retrySignal -> {
if (log.isDebugEnabled()) {
log.debug("Retry {} in bucket {} due to {}",
retrySignal.totalRetries(),
id.toString(),
retrySignal.failure().toString());
}
});
Copy link
Contributor Author

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.

Copy link
Member

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.

@Gregory-Widmer Gregory-Widmer marked this pull request as ready for review April 6, 2023 09:51
@quanticc quanticc added the API change Breaks public API in x.y releases, needs migration docs label Apr 8, 2023
@quanticc quanticc added this to the 3.3.0-M2 milestone Apr 8, 2023
@quanticc
Copy link
Member

quanticc commented Apr 8, 2023

Noting the current API and behavior changes for 3.2.x branch in a separate commit/PR

  • Remove ClientException#isRetryContextStatusCode
  • ResponseFunction#retryWhen signature change, now using reactor.util.retry.Retry
  • HTTP 500 errors max retries is 10 (previously unlimited)

@quanticc quanticc added the behavior change Please include migration notes label Apr 8, 2023
@quanticc quanticc linked an issue Jun 5, 2023 that may be closed by this pull request
@quanticc quanticc merged commit 709951f into Discord4J:master Jun 5, 2023
quanticc added a commit that referenced this pull request Jun 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API change Breaks public API in x.y releases, needs migration docs behavior change Please include migration notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

reactor.retry.Retry<T> is deprecated for removal
2 participants