Skip to content

chore: Give every write a server of its own when fetch gives up connecting. - #451

Merged
goloroden merged 1 commit into
mainfrom
fetch-gives-up-per-write
Nov 20, 2026
Merged

goloroden merged 1 commit into
mainfrom
fetch-gives-up-per-write

Conversation

@goloroden

Copy link
Copy Markdown
Member

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

…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
@goloroden
goloroden requested a review from a team as a code owner November 20, 2026 22:12
@goloroden goloroden self-assigned this Nov 20, 2026
@goloroden
goloroden merged commit 351d8f7 into main Nov 20, 2026
3 checks passed
@goloroden
goloroden deleted the fetch-gives-up-per-write branch November 20, 2026 22:14
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.

1 participant