Skip to content

A kept connection honours the router's Keep-Alive timeout (2.0.5) - #17

Merged
MorningLightMountain713 merged 2 commits into
RunOnFlux:mainfrom
MorningLightMountain713:fix/keep-alive-hint
Oct 20, 2026
Merged

MorningLightMountain713 merged 2 commits into
RunOnFlux:mainfrom
MorningLightMountain713:fix/keep-alive-hint

Conversation

@MorningLightMountain713

Copy link
Copy Markdown

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. keptIdleLimit reads 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

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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MorningLightMountain713
MorningLightMountain713 merged commit 48bc50f into RunOnFlux:main Oct 20, 2026
5 checks passed
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