-
Notifications
You must be signed in to change notification settings - Fork 634
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
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 with RequestTimeout: 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
- Select this option if this issue appears to be a regression.
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):
const s3client = new S3Client({ region: 'ap-southeast-2', logger: console });
const response = await s3client.send(new PutObjectCommand({
Bucket: process.env.BUCKET_NAME!,
Body: randomBytes(1024 * 100),
Key: randomUUID(),
ContentType: 'text/plain',
}));
Observed Behavior
After quite some time, the resulting error is:
RequestTimeout: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.
at throwDefaultError ... {
'$fault': 'client',
'$metadata': {
httpStatusCode: 400,
requestId: 'VT6TYR1KW11KX7TK',
extendedRequestId: 'az0TnxKnm01z0ioaVq72g1p22izk6qK6a2chdPs/uYIcJVRT1Vzz4w7ZuxBE7fFdeD8sPsxqHL0=',
cfId: undefined,
attempts: 3,
totalRetryDelay: 84
},
Code: 'RequestTimeout',
RequestId: 'VT6TYR1KW11KX7TK',
HostId: 'az0TnxKnm01z0ioaVq72g1p22izk6qK6a2chdPs/uYIcJVRT1Vzz4w7ZuxBE7fFdeD8sPsxqHL0='
}
Expected Behavior
If I change the version of @smithy/node-http-handler
to be used to 3.3.1 using resolutions
, 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 initial Expect: 100-continue
header. That's why this only occurred for us when making a request from Sweden to Sydney.