Skip to content

process: skip uncaught-exception dispatch on a terminating worker - #35678

Closed
robobun wants to merge 11 commits into
mainfrom
farm/409c20b8/uncaught-exception-termination-guard
Closed

process: skip uncaught-exception dispatch on a terminating worker#35678
robobun wants to merge 11 commits into
mainfrom
farm/409c20b8/uncaught-exception-termination-guard

widen uncaught_exception/handled_promise guards to script_execution_s…

e5390ce
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 25, 2026 in 33m 51s

Code review found 1 potential issue

Found 2 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/web_worker.rs:1138-1142 spin() checkpoint over-catches self-exit (drops parent 'online'); comment also misdescribes the window

Annotations

Check warning on line 1142 in src/jsc/web_worker.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

spin() checkpoint over-catches self-exit (drops parent 'online'); comment also misdescribes the window

This checkpoint fires on `has_requested_terminate()`, which `WebWorker::exit()` (the worker's own `process.exit()`) also sets — so when a worker's entry throws and an `uncaughtException` handler calls `process.exit(N)`, `handled==true` falls through to here and `shutdown()` is taken, skipping `WebWorker__dispatchOnline`; pre-PR the parent got `'online'` then `'exit'(N)`, post-PR only `'exit'(N)`. Consider gating on `&& !self.exit_called.load(Ordering::Relaxed)` so it only catches the cross-threa