Skip to content

fix(http): preserve server reference across close() for closeAllConnections() - #30505

Closed
robobun wants to merge 4 commits into
mainfrom
farm/c7da8917/fix-http-close-all-connections
Closed

fix(http): preserve server reference across close() for closeAllConnections()#30505
robobun wants to merge 4 commits into
mainfrom
farm/c7da8917/fix-http-close-all-connections

[autofix.ci] apply automated fixes

282497a
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jun 18, 2026 in 26m 52s

Code review found 1 potential issue

Found 3 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:410-419 ref() after close() re-refs the draining native server (missed kServerClosed migration)

Annotations

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

See this annotation in the file changed.

@claude claude / Claude Code Review

ref() after close() re-refs the draining native server (missed kServerClosed migration)

Same missed-`kServerClosed` migration family as the `emitListeningNextTick` and `setTimeout` findings above, third call site: `Server.prototype.ref` (line 359) does `this[serverSymbol]?.ref?.()` with no `kServerClosed` check. Pre-PR `close()` nulled `serverSymbol` synchronously so `server.close(); server.ref();` was a no-op (matching Node, where `net.Server.ref()` checks `this._handle`); now `ref()` reaches native `do_ref` → `poll_ref.ref_()` and re-pins the event loop on a server that is no lon