Uh oh!
There was an error while loading. Please reload this page.
perf(h1): drop idle-socket timer floor with a ref'd setImmediate - #5707
Conversation
Defer idle keep-alive validation to a ref'd setImmediate so it still runs after poll (GHSA-35p6-xmwp-9g52) without Node's setTimeout(0) timer floor or the unref'd-Immediate poll stall from #5606. Assisted by Cursor Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com>
codecov-commenter
commented
Aug 21, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## main #5707 +/- ##
=======================================
Coverage 93.47% 93.48% =======================================
Files 110 110 Lines 38892 38900 +8 =======================================
+ Hits 36354 36365 +11 + Misses 2538 2535 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Uh oh!
There was an error while loading. Please reload this page.
mcollina
commented
Aug 21, 2026
Historical note: #5609 proposed the same central fix as this PR.
Strictly speaking, #5609 was not formally rejected: it received no reviews and was voluntarily closed as apparently obsolete. Its branch was also rebased after #5606, so its final displayed diff no longer clearly represents the original ref'd-Immediate proposal. Nevertheless, #5609 is the closest prior proposal and belongs in the history of this change. |
This relates to...
Rationale
Sequential
fetch()/ HTTP/1.1 keep-alive reuse was paying Node'ssetTimeout(0)timer floor (~1.3–1.5ms) on every request. That dominates loopback / low-RTT workloads.#5499switched this tosetImmediateand was reverted in#5606because an unref'd Immediate lets poll block for ~500ms when the event loop is otherwise idle.Changes
setImmediateso it still runs after poll (poisoning protection) without the 1ms timer floor or the fix: revert idle socket validation to setTimeout(0) to prevent stall on idle event loop #5606 stall.fetchkeep-alive reuse stall regression test alongside the existing Pool test.benchmarks/fetch/sequential-keepalive.mjs.Features
N/A
Bug Fixes
N/A
Breaking Changes and Deprecations
N/A
Benchmarks
Re-run 2026-08-21 on Node v22.14.0 (linux x64, Intel Xeon, 4 cores). Medians of 5 runs vs
main@181c293.Sequential keep-alive
fetch().text()on loopback (connections: 1,pipelining: 1, 2000 iterations after 300 warmup):setTimeout(0))setImmediate)~7.5× faster at p50.
Status