Skip to content

A way to add to the default retry policy of a client #1755

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

Open
copumpkin opened this issue Mar 31, 2020 · 5 comments
Open

A way to add to the default retry policy of a client #1755

copumpkin opened this issue Mar 31, 2020 · 5 comments
Labels
feature-request A feature should be added or improved. p3 This is a minor priority issue

Comments

@copumpkin
Copy link

Describe the Feature

Sometimes I logically want to add a retry condition to a certain client, without changing the rest of its default retry policy, especially if it already uses a custom one like DynamoDB.

Is your Feature Request related to a problem?

I don't seem to have a way to get at this DynamoDbRetryPolicy class, for example, because it's marked as an internal API. Furthermore, I need to look at the SDK source code to even see which retry policy I should be aiming to modify or copy.

Proposed Solution

Not sure, maybe provide some sort of builder method that gives me access to the default value I'd be overriding?

Describe alternatives you've considered

Reflection to get at the internal class, but then it can break from commits like this.

Additional Context

N/A

@copumpkin copumpkin added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Mar 31, 2020
@copumpkin
Copy link
Author

The old SDK had PredefinedRetryPolicies (and similar Predefined classes) to facilitate stuff like this.

@cenedhryn
Copy link
Contributor

Can you give a code example of a typical usecase? Using 1) the (internal) DynamoDbRetryPolicy class 2) an imaginary builder method. It'd help to pinpoint what you want to achieve.

@copumpkin
Copy link
Author

I've gotten rid of my code that reflectively jumped into the internal DynamoDbRetryPolicy class, but from a high level I wanted to also retry on TransactionConflictException in addition to all the standard DDB retry behavior.

@copumpkin
Copy link
Author

As for the imaginary builder method, I'm not really sure what it would be. I could imagine exposing defaults in the builder classes themselves (not sure this happens today, vs. null/empty getting replaced further down), then having a builder method like .modifyX that takes a function from whatever X's type is to that same type, allowing me to consume the old one and replace it with a new one.

@zoewangg
Copy link
Contributor

The reason we decided to put service specific retry policy within service modules is to keep service specific logic out of core. I agree with you that predefined retry policies for each service can be difficult to extend now.

We might be able to exposing it in the builder class. Marking this as feature request.

@zoewangg zoewangg removed the needs-triage This issue or PR still needs to be triaged. label Apr 16, 2020
aws-sdk-java-automation added a commit that referenced this issue Oct 11, 2021
…1f2e29cea

Pull request: release <- staging/d1939746-3083-45a6-9812-ebc1f2e29cea
@yasminetalby yasminetalby added the p3 This is a minor priority issue label Nov 28, 2022
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. p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

4 participants