Repository navigation
A kept connection honours the router's Keep-Alive timeout (2.0.5) - #17
Merged
MorningLightMountain713 merged 2 commits intoOct 20, 2026
Conversation
A router that announces Keep-Alive: timeout=N has its kept connection closed 1 s before N, or KEPT_CONNECTION_IDLE_MS when that is sooner, and one announcing 1 s or less has none kept. Node 20 keeps such a socket itself; 22 and later refuse it, but read the hint only when timeout= leads the header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
A router that announces how long it keeps an idle connection (
Keep-Alive: timeout=N) has its kept connection closed 1 s before that, or at the library's own 3 s idle limit when that is sooner; a router announcing 1 s or less has no connection kept. A request no longer goes out on a connection the router is about to close.Node 20, the fleet's oldest, keeps a socket whatever the router announces; Node 22 and later honour the hint only when
timeout=leads the header.keptIdleLimitreads it wherever it stands, with the same 1 s margin Node uses.Tests
npm test: 896 passing, on Node 22 and on Node 20.8. Ignoring the router's shorter timeout turns its test red (expected 1000 ms, got 3000); keeping a connection the router said closes within 1 s turns its test red on Node 20.8.npm run flux-test:igd2: green against IGD v2 and IGD v1.🤖 Generated with Claude Code