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

Allow RetryStrategy to use information from RetryPolicyContext in BackoffStrategy #5303

Closed
2 tasks
awehrung opened this issue Jun 17, 2024 · 3 comments
Closed
2 tasks
Labels
feature-request A feature should be added or improved.

Comments

@awehrung
Copy link

Describe the feature

The new BackoffStrategy used by RetryStrategy should allow the method computeDelay to rely on more information than just the running attempt count, as does the old one used by RetryPolicy.

Use Case

While trying to switch from the now deprecated RetryPolicy to a RetryStrategy-based client, I noticed that I am unable to keep the same behaviour because my custom ...retry.backoff.BackoffStrategy::computeDelayBeforeNextRetry implementation relies on the RetryPolicyContext to decide on the actual duration and log some stuff as a side effect. The replacement ...retries.api.BackoffStrategy::computeDelay only allows access to the running attempt count.

Proposed Solution

As RetryPolicyContext has not been yet deprecated, I hope it still fits with the new RetryStrategy concept somehow.

Other Information

I may be doing this very wrong. In that case, kindly redirect me to the correct solution.

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS Java SDK version used

2.26.3

JDK version used

openjdk version "22.0.1" 2024-04-16

Operating System and version

Ubuntu 22.04.1

@awehrung awehrung added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jun 17, 2024
@sugmanue
Copy link
Contributor

Hi @awehrung

One of the objectives of the new retry strategies design is to decouple it from the sdk-core and aws-core package, and as part of this we won't be adding back that coupling. You can still use the RetryPolicy classes for your use case, those will be still supported for the foreseeable future.

@sugmanue
Copy link
Contributor

Won't fix for the reasons give above.

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

@debora-ito debora-ito removed the needs-triage This issue or PR still needs to be triaged. label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

3 participants