Skip to content

node:http: make closeAllConnections()/closeIdleConnections() leave the listener alone and work after close() - #35839

Open
robobun wants to merge 11 commits into
mainfrom
farm/6ccde698/http-close-connections-after-close
Open

node:http: make closeAllConnections()/closeIdleConnections() leave the listener alone and work after close()#35839
robobun wants to merge 11 commits into
mainfrom
farm/6ccde698/http-close-connections-after-close

trim drain-method comments

cc0449b
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 26, 2026 in 22m 33s

Code review found 1 potential issue

Found 1 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/js/node/_http_server.ts:506 closeIdleConnections() skips finished-but-not-detached responses that Node destroys

Annotations

Check warning on line 506 in src/js/node/_http_server.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

closeIdleConnections() skips finished-but-not-detached responses that Node destroys

Node.js's `closeIdleConnections()` skips on `socket._httpMessage && !socket._httpMessage.finished`, so a socket whose response has `finished === true` (set synchronously by `res.end()`) is treated as idle and destroyed; this predicate checks only truthy `socket._httpMessage`, so a socket in the one-tick window between `res.end()` and the deferred `detachSocket` is spared. The divergence is conservative and the canonical `close(); setTimeout(closeIdleConnections, grace)` pattern never hits it, bu