-
Notifications
You must be signed in to change notification settings - Fork 597
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
S3 PutObject between regions fails after @smithy/node-http-handler 3.3.2 #6805
Comments
Thanks for submitting the report and the fix PR. To work around this in the existing 3.x version, set a requestTimeout on the client requestHandler. // example
new S3Client({
requestHandler: { requestTimeout: 8_000 }
}); I've approved your fix PR and will publish it soon. However, the fix will only apply to SDK clients v3.723.0 and higher which have a 4.x dependency on |
Before I merge the fix, I am checking the intended behavior. |
From reading about how Expect: 100-continue works, the behavior of sending the body after 1 second even if no 100 Continue response had been received did seem quite odd to me. But that was the previous behavior, and the change that broke it did not seem to do so intentionally since presumably the server did respond with a 100 Continue, just after longer than 1 second, and if the server didn't close the connection the client would just sit there forever after the 1 second timeout. My uneducated guess is that this behavior was modeled around how cURL does it, where indeed it continues anyway after waiting for 1 second. I've also verified that increasing the request timeout works around the issue, in case someone else comes in here from searching the internet. It's a bit unfortunate to have the request timeout pull double-duty, I feel, since I probably don't want to wait 10 seconds for just a |
I'm merging the PR but also increasing the default 100-continue timeout to 6s. The intended behavior at the 1s mark is not to send the body but to keep waiting for the 100-continue event. At 6s, it's more likely that something is wrong (like the server isn't the real S3 and didn't implement 100-continue) so it's more acceptable to attempt to send the body after this waiting period. |
The fix was released in https://www.npmjs.com/package/@smithy/node-http-handler/v/4.0.2, which can be picked up with a fresh install or modifying the lockfile for https://github.com/aws/aws-sdk-js-v3/releases/tag/v3.723.0 and higher. Previous versions of the SDK using 3.x of |
Checkboxes for prior research
Describe the bug
When doing a PutObject request using versions of
@smithy/node-http-handler
equal or higher than 3.3.2 from eu-north-1 to ap-southeast-2 the request fails withRequestTimeout: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.
after a long period of doing nothing. Making the same request using version 3.3.1 or lower works.Regression Issue
SDK version number
@aws-sdk/[email protected]
@smithy/[email protected] (or higher)
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v20.11.1
Reproduction Steps
To reproduce, I simply created an S3 bucket in ap-southeast-2 and issued a PutObject request from my local computer (located in Stockholm):
Observed Behavior
After quite some time, the resulting error is:
Expected Behavior
If I change the version of
@smithy/node-http-handler
to be used to 3.3.1 usingresolutions
, the request works.Possible Solution
Fixed in smithy-lang/smithy-typescript#1505
Additional Information/Context
The issue happens only if it takes more than 1000ms for the server to send the
100 Continue
response after the client sends the initialExpect: 100-continue
header. That's why this only occurred for us when making a request from Sweden to Sydney.The text was updated successfully, but these errors were encountered: