aws-sdk-rust: GoAway errors using the SDK
Describe the bug
I am seeing such errors when using aws polly after an arbitrary amount of time (can be hours, can be minutes):
0:06:15.734081193 132822 0x7fbbc4000f70 ERROR awspolly imp.rs:227:gstaws::polly::imp::Polly::send::{{closure}}::{{closure}}:<awspolly0> Failed sending text chunk: dispatch failure (DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: hyper::Error(Http2, Error { kind: GoAway(b"", NO_ERROR, Remote) }), connection: Unknown } })) (dispatch failure: other: http2 error: connection error received: not a result of an error: connection error received: not a result of an error (DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: hyper::Error(Http2, Error { kind: GoAway(b"", NO_ERROR, Remote) }), connection: Unknown } })))
As I understand it it should be up to the SDk to retry in such cases, not the application?
Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
I don’t expect GoAway errors to surface to my application
Current Behavior
GoAway errors surface to my application
Reproduction Steps
I do not have a readymade sample for this
Possible Solution
No response
Additional Information/Context
No response
Version
│ ├── aws-config v1.6.1
│ │ ├── aws-credential-types v1.2.2
│ │ │ ├── aws-smithy-async v1.2.5
│ │ │ ├── aws-smithy-runtime-api v1.7.4
│ │ │ │ ├── aws-smithy-async v1.2.5 (*)
│ │ │ │ ├── aws-smithy-types v1.3.0
│ │ │ ├── aws-smithy-types v1.3.0 (*)
│ │ ├── aws-runtime v1.5.6
│ │ │ ├── aws-credential-types v1.2.2 (*)
│ │ │ ├── aws-sigv4 v1.3.0
│ │ │ │ ├── aws-credential-types v1.2.2 (*)
│ │ │ │ ├── aws-smithy-eventstream v0.60.8
│ │ │ │ │ ├── aws-smithy-types v1.3.0 (*)
│ │ │ │ ├── aws-smithy-http v0.62.0
│ │ │ │ │ ├── aws-smithy-eventstream v0.60.8 (*)
│ │ │ │ │ ├── aws-smithy-runtime-api v1.7.4 (*)
│ │ │ │ │ ├── aws-smithy-types v1.3.0 (*)
│ │ │ │ ├── aws-smithy-runtime-api v1.7.4 (*)
│ │ │ │ ├── aws-smithy-types v1.3.0 (*)
│ │ │ ├── aws-smithy-async v1.2.5 (*)
│ │ │ ├── aws-smithy-eventstream v0.60.8 (*)
│ │ │ ├── aws-smithy-http v0.62.0 (*)
│ │ │ ├── aws-smithy-runtime v1.8.1
│ │ │ │ ├── aws-smithy-async v1.2.5 (*)
│ │ │ │ ├── aws-smithy-http v0.62.0 (*)
│ │ │ │ ├── aws-smithy-http-client v1.0.1
│ │ │ │ │ ├── aws-smithy-async v1.2.5 (*)
│ │ │ │ │ ├── aws-smithy-runtime-api v1.7.4 (*)
│ │ │ │ │ ├── aws-smithy-types v1.3.0 (*)
│ │ │ │ │ │ │ ├── aws-lc-rs v1.13.0
│ │ │ │ │ │ │ │ ├── aws-lc-sys v0.28.0
│ │ │ │ │ │ │ │ ├── aws-lc-rs v1.13.0 (*)
│ │ │ │ ├── aws-smithy-observability v0.1.2
│ │ │ │ │ ├── aws-smithy-runtime-api v1.7.4 (*)
│ │ │ │ ├── aws-smithy-runtime-api v1.7.4 (*)
│ │ │ │ ├── aws-smithy-types v1.3.0 (*)
│ │ │ ├── aws-smithy-runtime-api v1.7.4 (*)
│ │ │ ├── aws-smithy-types v1.3.0 (*)
│ │ │ ├── aws-types v1.3.6
│ │ │ │ ├── aws-credential-types v1.2.2 (*)
│ │ │ │ ├── aws-smithy-async v1.2.5 (*)
│ │ │ │ ├── aws-smithy-runtime-api v1.7.4 (*)
│ │ │ │ ├── aws-smithy-types v1.3.0 (*)
│ │ ├── aws-sdk-sso v1.64.0
│ │ │ ├── aws-credential-types v1.2.2 (*)
│ │ │ ├── aws-runtime v1.5.6 (*)
│ │ │ ├── aws-smithy-async v1.2.5 (*)
│ │ │ ├── aws-smithy-http v0.62.0 (*)
│ │ │ ├── aws-smithy-json v0.61.3
│ │ │ │ └── aws-smithy-types v1.3.0 (*)
│ │ │ ├── aws-smithy-runtime v1.8.1 (*)
│ │ │ ├── aws-smithy-runtime-api v1.7.4 (*)
│ │ │ ├── aws-smithy-types v1.3.0 (*)
│ │ │ ├── aws-types v1.3.6 (*)
│ │ ├── aws-sdk-ssooidc v1.65.0
│ │ │ ├── aws-credential-types v1.2.2 (*)
│ │ │ ├── aws-runtime v1.5.6 (*)
│ │ │ ├── aws-smithy-async v1.2.5 (*)
│ │ │ ├── aws-smithy-http v0.62.0 (*)
│ │ │ ├── aws-smithy-json v0.61.3 (*)
│ │ │ ├── aws-smithy-runtime v1.8.1 (*)
│ │ │ ├── aws-smithy-runtime-api v1.7.4 (*)
│ │ │ ├── aws-smithy-types v1.3.0 (*)
│ │ │ ├── aws-types v1.3.6 (*)
│ │ ├── aws-sdk-sts v1.65.0
│ │ │ ├── aws-credential-types v1.2.2 (*)
│ │ │ ├── aws-runtime v1.5.6 (*)
│ │ │ ├── aws-smithy-async v1.2.5 (*)
│ │ │ ├── aws-smithy-http v0.62.0 (*)
│ │ │ ├── aws-smithy-json v0.61.3 (*)
│ │ │ ├── aws-smithy-query v0.60.7
│ │ │ │ ├── aws-smithy-types v1.3.0 (*)
│ │ │ ├── aws-smithy-runtime v1.8.1 (*)
│ │ │ ├── aws-smithy-runtime-api v1.7.4 (*)
│ │ │ ├── aws-smithy-types v1.3.0 (*)
│ │ │ ├── aws-smithy-xml v0.60.9
│ │ │ ├── aws-types v1.3.6 (*)
│ │ ├── aws-smithy-async v1.2.5 (*)
│ │ ├── aws-smithy-http v0.62.0 (*)
│ │ ├── aws-smithy-json v0.61.3 (*)
│ │ ├── aws-smithy-runtime v1.8.1 (*)
│ │ ├── aws-smithy-runtime-api v1.7.4 (*)
│ │ ├── aws-smithy-types v1.3.0 (*)
│ │ ├── aws-types v1.3.6 (*)
│ ├── aws-credential-types v1.2.2 (*)
│ ├── aws-sdk-polly v1.68.0
│ │ ├── aws-credential-types v1.2.2 (*)
│ │ ├── aws-runtime v1.5.6 (*)
│ │ ├── aws-sigv4 v1.3.0 (*)
│ │ ├── aws-smithy-async v1.2.5 (*)
│ │ ├── aws-smithy-http v0.62.0 (*)
│ │ ├── aws-smithy-json v0.61.3 (*)
│ │ ├── aws-smithy-runtime v1.8.1 (*)
│ │ ├── aws-smithy-runtime-api v1.7.4 (*)
│ │ ├── aws-smithy-types v1.3.0 (*)
│ │ ├── aws-types v1.3.6 (*)
│ ├── aws-sdk-s3 v1.82.0
│ │ ├── aws-credential-types v1.2.2 (*)
│ │ ├── aws-runtime v1.5.6 (*)
│ │ ├── aws-sigv4 v1.3.0 (*)
│ │ ├── aws-smithy-async v1.2.5 (*)
│ │ ├── aws-smithy-checksums v0.63.1
│ │ │ ├── aws-smithy-http v0.62.0 (*)
│ │ │ ├── aws-smithy-types v1.3.0 (*)
│ │ ├── aws-smithy-eventstream v0.60.8 (*)
│ │ ├── aws-smithy-http v0.62.0 (*)
│ │ ├── aws-smithy-json v0.61.3 (*)
│ │ ├── aws-smithy-runtime v1.8.1 (*)
│ │ ├── aws-smithy-runtime-api v1.7.4 (*)
│ │ ├── aws-smithy-types v1.3.0 (*)
│ │ ├── aws-smithy-xml v0.60.9 (*)
│ │ ├── aws-types v1.3.6 (*)
│ ├── aws-sdk-transcribestreaming v1.66.0
│ │ ├── aws-credential-types v1.2.2 (*)
│ │ ├── aws-runtime v1.5.6 (*)
│ │ ├── aws-sigv4 v1.3.0 (*)
│ │ ├── aws-smithy-async v1.2.5 (*)
│ │ ├── aws-smithy-eventstream v0.60.8 (*)
│ │ ├── aws-smithy-http v0.62.0 (*)
│ │ ├── aws-smithy-json v0.61.3 (*)
│ │ ├── aws-smithy-runtime v1.8.1 (*)
│ │ ├── aws-smithy-runtime-api v1.7.4 (*)
│ │ ├── aws-smithy-types v1.3.0 (*)
│ │ ├── aws-types v1.3.6 (*)
│ ├── aws-sdk-translate v1.64.0
│ │ ├── aws-credential-types v1.2.2 (*)
│ │ ├── aws-runtime v1.5.6 (*)
│ │ ├── aws-smithy-async v1.2.5 (*)
│ │ ├── aws-smithy-http v0.62.0 (*)
│ │ ├── aws-smithy-json v0.61.3 (*)
│ │ ├── aws-smithy-runtime v1.8.1 (*)
│ │ ├── aws-smithy-runtime-api v1.7.4 (*)
│ │ ├── aws-smithy-types v1.3.0 (*)
│ │ ├── aws-types v1.3.6 (*)
│ ├── aws-types v1.3.6 (*)
Environment details (OS name and version, etc.)
Linux Fedora 40
Logs
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (6 by maintainers)
Hey @aajtodd @landonxjames I’ve managed to reproduce this error in a repository here: https://github.com/Veetaha/aws-sdk-rust-go-away-retries-bug-repro. You can clone it and just do
cargo runwhere you’ll see the error and the warning in the terminal.For that I had to fork
hyper 0.14.32and patch it with some code that synthetically injects theGoAwayerror (https://github.com/Veetaha/hyper/commit/0a82bb74fe98280c24337e612805ed698550fd2c).The core problem is in how the
aws-sdk-lambdaandaws-configare configured with Rust features.We are using the legacy
rustlsfeature, because we just can’t compileaws-lc-syson our supported windows platforms. So we have to disable it, but this unfortunately pulls in the oldhyper 0.14.32version.In turn, this means that we are using the
hyper_legacy.rsimplementation of theHttpConnector. However, when AWS SDK was migrating tohyper 1.0a nuance was missed thathyper 1.0depends on the version0.4of theh2crate. However,hyper 0.14.32depends on0.3of theh2crate.And
aws-smithy-http-clientdepends onh2 0.4unconditionally. So this code here: https://github.com/awslabs/aws-sdk-rust/blob/8604e6c91cd61515f16cb85e6a90347711b5e728/sdk/aws-smithy-http-client/src/hyper_legacy.rs#L385It uses the wrong version of the
h2crate. It must use theh2 0.3instead of0.4when downcasting the error toh2::Error.Fantastic reproduction @Veetaha, thank you!
PR up to fix this: https://github.com/smithy-lang/smithy-rs/pull/4145
Level::TRACE would be most helpful since we could see all of the logs