Skip to content

Conversation

@kuhe
Copy link
Contributor

@kuhe kuhe commented Oct 22, 2025

Issue #, if available:

aws/aws-sdk-js-v3#6940

This pairs with aws/aws-sdk-js-v3#7450 which allows the criteria of the expect 100-continue header to be configured by the S3 Client owner.

Description of changes:

This PR moves http1.1 requests having header expect: 100-continue to separate http(s) Agent instances. The presence of the header causes a confusion (crossed streams style) in the transmission of http headers and bodies in the Node.js http/https modules when using shared Agent instances and Buffer/Uint8Array payloads under conditions described in the linked issue.

This is despite referential consistency in how the requests are invoked and no stray mutations in the user code, so at this point I suspect a bug or at least undocumented behavior in http(s) Agent sockets. It also only happens with Buffers and not strings. This shouldn't be related to shared Buffer memory misuse either, since I tried copying standalone Uint8Arrays at the call sites synchronously.


As a side effect of using isolated Agents, these requests will not be subject to the socket limits nor socket reuse intentions placed on the NodeHttpHandler's Agent by the downstream consumer.

@kuhe kuhe requested a review from a team as a code owner October 22, 2025 17:27
@kuhe kuhe force-pushed the fix/http1 branch 2 times, most recently from 646f029 to 63f2298 Compare October 22, 2025 18:20
@kuhe kuhe merged commit 344d06a into main Oct 22, 2025
13 checks passed
@kuhe kuhe deleted the fix/http1 branch October 22, 2025 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants