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

Support custom retry classifier on generated clients #2405

Closed
DanielBauman88 opened this issue Feb 22, 2023 · 2 comments
Closed

Support custom retry classifier on generated clients #2405

DanielBauman88 opened this issue Feb 22, 2023 · 2 comments

Comments

@DanielBauman88
Copy link
Contributor

DanielBauman88 commented Feb 22, 2023

Rust does not support this (unless I've missed it).
https://docs.aws.amazon.com/sdk-for-rust/latest/dg/retries.html

RetryConfig only supports mode, max_attempts, and initial_backoff.

This is limiting and makes writing client code painful if custom retry strategies are needed. EG: If the desired client behaviour is retrying ddb conditonal check failed exceptions this can't be configured on the ddb client, the check has to be applied in code each time a call is made.

This limitation does not exist for the java sdk where arbitrary retry logic can be defined based on the request, response and number of retries.

  1. It would be great to support custom retry behaviour like default + x in the rust generated clients.
  2. Is there a hackier way to achieve this while the SDK doesn't support it in a first class way? I had some success doing something similar with the go sdk using custom middleware, but I haven't figured out how to apply custom middleware with the generated rust interfaces.
@DanielBauman88
Copy link
Contributor Author

@DanielBauman88
Copy link
Contributor Author

It would be helpful to have a way to set the RetryClassifier that will be used by the client.
That would allow for a RetryClassifier to be set which makes use of the default and adds additional logic for retry.

Default: https://github.com/awslabs/smithy-rs/blob/main/rust-runtime/aws-smithy-http/src/retry.rs#L23

@DanielBauman88 DanielBauman88 changed the title Support custom retry behaviour on generated clients Support custom retry classifier on generated clients Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant