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

DispatchFailure: HTTP/2 REFUSED_STREAM should be retried #858

Closed
FSMaxB opened this issue Aug 2, 2023 · 5 comments
Closed

DispatchFailure: HTTP/2 REFUSED_STREAM should be retried #858

FSMaxB opened this issue Aug 2, 2023 · 5 comments
Labels
bug This issue is a bug. p2 This is a standard priority issue

Comments

@FSMaxB
Copy link

FSMaxB commented Aug 2, 2023

Describe the bug

We regularly get an HTTP/2 REFUSED_STREAM error in production when deleting S3 blobs. This error means that a request should be retried, so I'm opening an issue based on the following warning that was emitted:

aws_smithy_client::hyper_ext
unrecognized error from Hyper. If this error should be retried, please file an issue.

{err: http2 error: stream error received: refused stream before processing any application logic: stream error received: refused stream before processing any application logic (hyper::Error(Http2, Error { kind: Reset(StreamId(243), REFUSED_STREAM, Remote) }))}

See https://datatracker.ietf.org/doc/html/rfc9113#REFUSED_STREAM and https://datatracker.ietf.org/doc/html/rfc9113#Reliability saying that such requests can be safely retried.

Expected Behavior

When calling DispatchFailure::other, it should have returned Some. Unclear which ErrorKind exactly, but probably ErrorKind::ServerError.

Current Behavior

When calling DispatchFailure::other, it returns None.

Reproduction Steps

I haven't found a way to reproduce this yet, I can only see it in production sometimes when using aws-sdk-s3 against the google cloud storage API.

Possible Solution

Treat the REFUSED_STREAM error as aws_smithy_types::retry::ErrorKind::ServerError

Additional Information/Context

No response

Version

$ cargo tree | grep aws -
├── aws-sdk-s3 v0.28.0
│   ├── aws-credential-types v0.55.3
│   │   ├── aws-smithy-async v0.55.3
│   │   ├── aws-smithy-types v0.55.3
│   ├── aws-endpoint v0.55.3
│   │   ├── aws-smithy-http v0.55.3
│   │   │   ├── aws-smithy-eventstream v0.55.3
│   │   │   │   ├── aws-smithy-types v0.55.3 (*)
│   │   │   ├── aws-smithy-types v0.55.3 (*)
│   │   ├── aws-smithy-types v0.55.3 (*)
│   │   ├── aws-types v0.55.3
│   │   │   ├── aws-credential-types v0.55.3 (*)
│   │   │   ├── aws-smithy-async v0.55.3 (*)
│   │   │   ├── aws-smithy-client v0.55.3
│   │   │   │   ├── aws-smithy-async v0.55.3 (*)
│   │   │   │   ├── aws-smithy-http v0.55.3 (*)
│   │   │   │   ├── aws-smithy-http-tower v0.55.3
│   │   │   │   │   ├── aws-smithy-http v0.55.3 (*)
│   │   │   │   │   ├── aws-smithy-types v0.55.3 (*)
│   │   │   │   ├── aws-smithy-types v0.55.3 (*)
│   │   │   ├── aws-smithy-http v0.55.3 (*)
│   │   │   ├── aws-smithy-types v0.55.3 (*)
│   ├── aws-http v0.55.3
│   │   ├── aws-credential-types v0.55.3 (*)
│   │   ├── aws-smithy-http v0.55.3 (*)
│   │   ├── aws-smithy-types v0.55.3 (*)
│   │   ├── aws-types v0.55.3 (*)
│   ├── aws-sig-auth v0.55.3
│   │   ├── aws-credential-types v0.55.3 (*)
│   │   ├── aws-sigv4 v0.55.3
│   │   │   ├── aws-smithy-eventstream v0.55.3 (*)
│   │   │   ├── aws-smithy-http v0.55.3 (*)
│   │   ├── aws-smithy-eventstream v0.55.3 (*)
│   │   ├── aws-smithy-http v0.55.3 (*)
│   │   ├── aws-types v0.55.3 (*)
│   ├── aws-sigv4 v0.55.3 (*)
│   ├── aws-smithy-async v0.55.3 (*)
│   ├── aws-smithy-checksums v0.55.3
│   │   ├── aws-smithy-http v0.55.3 (*)
│   │   ├── aws-smithy-types v0.55.3 (*)
│   ├── aws-smithy-client v0.55.3 (*)
│   ├── aws-smithy-eventstream v0.55.3 (*)
│   ├── aws-smithy-http v0.55.3 (*)
│   ├── aws-smithy-http-tower v0.55.3 (*)
│   ├── aws-smithy-json v0.55.3
│   │   └── aws-smithy-types v0.55.3 (*)
│   ├── aws-smithy-types v0.55.3 (*)
│   ├── aws-smithy-xml v0.55.3
│   ├── aws-types v0.55.3 (*)
├── aws-smithy-async v0.55.3 (*)
├── aws-smithy-http v0.55.3 (*)
├── aws-smithy-types v0.55.3 (*)
├── aws-sdk-s3 v0.28.0 (*)

Environment details (OS name and version, etc.)

Docker on Linux (not really relevant)

Logs

As shown above:

aws_smithy_client::hyper_ext
unrecognized error from Hyper. If this error should be retried, please file an issue.

{err: http2 error: stream error received: refused stream before processing any application logic: stream error received: refused stream before processing any application logic (hyper::Error(Http2, Error { kind: Reset(StreamId(243), REFUSED_STREAM, Remote) }))}
@FSMaxB FSMaxB added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 2, 2023
@Velfi Velfi removed the needs-triage This issue or PR still needs to be triaged. label Aug 2, 2023
@Velfi
Copy link
Contributor

Velfi commented Aug 2, 2023

Hey @FSMaxB, thanks for submitting this issue. We'll add it to our backlog.

@rcoh rcoh added the p2 This is a standard priority issue label Aug 8, 2023
@FSMaxB
Copy link
Author

FSMaxB commented Aug 24, 2023

Might also be this issue: hyperium/h2#707

I'll report back wether that already fixes it once I have that version running in production.

rcoh added a commit to smithy-lang/smithy-rs that referenced this issue Sep 5, 2023
This PR adds two additional classes of retries tested:
1. GO_AWAY: awslabs/aws-sdk-rust#738
2. REFUSED_STREAM: awslabs/aws-sdk-rust#858

I tested 1 by using the example helpfully provided. The fix for 2 is untested and difficult to reproduce but since my fix for 1 worked, I'm confident that we're detecting the correct error class here.
@FSMaxB
Copy link
Author

FSMaxB commented Sep 7, 2023

The new h2 release actually fixes this for my use-case. There might still be other scenarios that trigger this though.

rcoh added a commit to smithy-lang/smithy-rs that referenced this issue Sep 7, 2023
This PR adds two additional classes of retries tested:
1. GO_AWAY: awslabs/aws-sdk-rust#738
2. REFUSED_STREAM: awslabs/aws-sdk-rust#858

I tested 1 by using the example helpfully provided. The fix for 2 is untested and difficult to reproduce but since my fix for 1 worked, I'm confident that we're detecting the correct error class here.
rcoh added a commit to smithy-lang/smithy-rs that referenced this issue Sep 12, 2023
This PR adds two additional classes of retries tested:
1. GO_AWAY: awslabs/aws-sdk-rust#738
2. REFUSED_STREAM: awslabs/aws-sdk-rust#858

I tested 1 by using the example helpfully provided. The fix for 2 is untested and difficult to reproduce but since my fix for 1 worked, I'm confident that we're detecting the correct error class here.
github-merge-queue bot pushed a commit to smithy-lang/smithy-rs that referenced this issue Sep 12, 2023
Draft pull request pending merge of #2970 
## Motivation and Context
- awslabs/aws-sdk-rust#738
- awslabs/aws-sdk-rust#858
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->

## Description
<!--- Describe your changes in detail -->
This PR adds two additional classes of retries tested:
1. GO_AWAY: awslabs/aws-sdk-rust#738
2. REFUSED_STREAM: awslabs/aws-sdk-rust#858

I tested 1 by using the example helpfully provided. The fix for 2 is
untested and difficult to reproduce but since my fix for 1 worked, I'm
confident that we're detecting the correct error class here.

## Testing
I used the example provided by the customer and validated the H2 GO_AWAY
fix.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
@jdisanti
Copy link
Contributor

jdisanti commented Dec 6, 2023

Built-in retry was added for this error in the December 5, 2023 release.

@jdisanti jdisanti closed this as completed Dec 6, 2023
Copy link

github-actions bot commented Dec 6, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

4 participants