Skip to content

node:net: publish diagnostics_channel events (net.client.socket, net.server.socket, net.server.listen) - #34209

Open
robobun wants to merge 4 commits into
mainfrom
farm/080071de/net-diagnostics-channel
Open

node:net: publish diagnostics_channel events (net.client.socket, net.server.socket, net.server.listen)#34209
robobun wants to merge 4 commits into
mainfrom
farm/080071de/net-diagnostics-channel

node:net: publish net.client.socket, net.server.socket and net.server…

53f3969
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 15, 2026 in 16m 33s

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/net.ts:3455-3462 netServerListen.error not published on cluster-worker listen failure

Annotations

Check warning on line 3462 in src/js/node/net.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

netServerListen.error not published on cluster-worker listen failure

In a cluster worker, `listenInCluster` calls `cluster._getServer` (async IPC) and `listenOnPrimaryHandle` runs after this try/catch has already returned — so a throw from `checkBindError` (net.ts:3675) or `kRealListen` on that path never reaches this `netServerListen.error.publish`, leaving subscribers with an `asyncStart` and no matching `error`/`asyncEnd`. Node avoids this by publishing from inside `setupListenHandle` itself, which both the primary and worker paths reach; mirroring that (or wr