Skip to content

worker_threads: drain port-backed stdio on process.exit() - #34340

Closed
robobun wants to merge 10 commits into
mainfrom
farm/e08659a7/worker-stdio-exit-drain
Closed

robobun wants to merge 10 commits into
mainfrom
farm/e08659a7/worker-stdio-exit-drain

Run the exit-drain tests concurrently

accf6bb
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 30, 2026 in 12m 52s

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/worker_threads.ts:445-446 flushInFlightForExit exposed as public string property on process.stdout/stderr and worker.stdin

Annotations

Check warning on line 446 in src/js/node/worker_threads.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

flushInFlightForExit exposed as public string property on process.stdout/stderr and worker.stdin

`flushInFlightForExit` is stored as a plain string-keyed property on the same Writable objects installed as `process.stdout`/`process.stderr` (and on parent-side `worker.stdin`, since `makePortWritable` is shared), and the exit handler then routes through that user-overridable property. This violates the `src/js/` tamper-resistance rule ("never route internal logic through user-overridable machinery") and diverges from the Node reference this PR cites, which keys the same hook via the module-pri