Repository navigation
chore: Give every write a server of its own when fetch gives up connecting. - #451
Merged
Merged
Conversation
…cting. Since undici 8.11, which Node.js bundles from 26.11 on, the pool of fetch opens one connection per origin at a time and lets further requests wait. When that connection never completes its TLS handshake, the waiting requests get their turn one after another, so four writes against one server gave up after 10, 21, 31 and 42 seconds, and the test ran into its 20-second limit with Node.js 26.13.1 (#450). Each write now has a test and a server of its own, and the suite leaves room for four of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FzFci9EsPi8wnfncwsRgg8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With Node.js 26.13.1 (#450), the test "throws the error of fetch itself if fetch gives up connecting" ran into its 20-second limit in both QA jobs. The cause is in undici 8.11 and later, which Node.js bundles from 26.11 on: the pool of fetch opens one connection per origin at a time and lets further requests wait for it (nodejs/undici#5799). When that connection never completes its TLS handshake, the waiting requests get their turn one after another. Measured against a server that accepts but never answers the handshake, four concurrent fetches gave up after 10.5 s each with Node.js 26.3.1, and after 10.5, 21.0, 31.5 and 42.0 s with 26.13.1; a single fetch still gives up after 10.5 s.
The test ran all four writes at once against one server. Each write now has a test of its own, and with it a server and an origin of its own, so what the test checks stays the same: the SDK hands on the error of fetch itself. The suite's timeout, a guard against hanging, now leaves room for the four tests of about ten seconds each. The SDK itself does not change.
Locally, all 13 tests of the file pass with both Node.js 26.3.1 and 26.13.1.
🤖 Generated with Claude Code
https://claude.ai/code/session_01FzFci9EsPi8wnfncwsRgg8