Skip to content

node:vm: enforce timeout as a wall-clock deadline that interrupts Atomics.wait - #33764

Open
robobun wants to merge 4 commits into
mainfrom
claude/farm/1771cc13/vm-timeout-atomics-wait
Open

node:vm: enforce timeout as a wall-clock deadline that interrupts Atomics.wait#33764
robobun wants to merge 4 commits into
mainfrom
claude/farm/1771cc13/vm-timeout-atomics-wait

node:vm: enforce timeout as a wall-clock deadline that interrupts Ato…

79dc203
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 8, 2026 in 43m 13s

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/jsc/bindings/vm/TimeoutWatchdog.cpp:35-39 Nudge loop only wakes syncWaiter; a nested clearTerminationState() can neuter an already-fired outer watchdog

Annotations

Check warning on line 39 in src/jsc/bindings/vm/TimeoutWatchdog.cpp

See this annotation in the file changed.

@claude claude / Claude Code Review

Nudge loop only wakes syncWaiter; a nested clearTerminationState() can neuter an already-fired outer watchdog

Nit: after `fire()`, this nudge loop only re-notifies the sync waiter — it never re-asserts `setHasTerminationRequest()` / `notifyNeedTermination()`. If a nested inner `node:vm` scope's own watchdog fires and its `clearTerminationState()` runs after this outer watchdog has already fired, the inner clear wipes the outer's `hasTerminationRequest` flag and `NeedTermination` trap; the outer script can then catch the inner's `ERR_SCRIPT_EXECUTION_TIMEOUT` and enter a CPU-bound loop that this notify (