-
Notifications
You must be signed in to change notification settings - Fork 190
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
Fix native Smithy client retry and retry response errors #1717
Conversation
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
Need to decide what to do about the "retry policy" to "response classifier" rename. The "response classifier" name is a lot more accurate, but the rename goes deep since the operation That example also mentions "retry every second until the table is ready" in its comments, but I highly doubt that's what's actually happening. It's probably using exponential backoff. |
It's using I'd recommend doing the rename, adding new methods, deprecating the old ones, and deleting them in a future release to simplify coordination |
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.
😍
@@ -186,3 +186,21 @@ message = "Smithy IDL v2 mixins are now supported" | |||
references = ["smithy-rs#1680"] | |||
meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "all"} | |||
author = "ogudavid" | |||
|
|||
[[smithy-rs]] | |||
message = "Generated clients now retry transient errors without replacing the retry policy." |
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.
message = "Generated clients now retry transient errors without replacing the retry policy." | |
message = "White-label smithy clients now have a default retry policy and will retry requests returning a transient HTTP error." |
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.
White label/adhoc AWS clients already had retry. This is specifically fixing for Smithy clients. I think this should be clear by it being a smithy-rs
entry.
pub struct AwsResponseClassifier; | ||
|
||
impl AwsResponseClassifier { | ||
/// Create an `AwsResponseClassifier` with the default set of known error & status codes |
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.
It'd be cool if we could link to code or docs showing what errors get retried
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.
If there is a way to link to the private constants with rustdoc, then I could add this pretty easily. I'm reluctant to duplicate the list in the documentation since it will get out of date.
...kotlin/software/amazon/smithy/rust/codegen/smithy/generators/client/FluentClientGenerator.kt
Outdated
Show resolved
Hide resolved
@jdisanti Will you be submitting an examples update PR as well? |
A new generated diff is ready to view.
A new doc preview is ready to view. |
Yeah. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
Examples fixed in awsdocs/aws-doc-sdk-examples#3593 |
A new generated diff is ready to view.
A new doc preview is ready to view. |
@@ -102,7 +103,10 @@ mod tests { | |||
}); | |||
|
|||
let mut svc = ServiceBuilder::new() | |||
.layer(ParseResponseLayer::<TestParseResponse, ()>::new()) | |||
.layer(ParseResponseLayer::< | |||
TestParseResponse, |
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.
Consider calling this "TestResponseHandler" or, instead, changing the verbiage for "response handler" to "response parser"
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 think the name is actually fine considering it implements ParseStrictResponse
. I think handler
might actually be the out of place name that should potentially get fixed in other places.
Co-authored-by: Zelda Hessler <[email protected]>
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
Motivation and Context
This PR addresses awslabs/aws-sdk-rust#303 and #1715.
Checklist
CHANGELOG.next.toml
if I made changes to the smithy-rs codegen or runtime cratesCHANGELOG.next.toml
if I made changes to the AWS SDK, generated SDK code, or SDK runtime cratesBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.