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

flush_logs: key early-return on JSC trap; 2-level test; extract repor…

eac2ac3
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 25, 2026 in 30m 50s

Code review found 3 potential issues

Found 1 candidates, confirmed 3. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 3
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/jsc/web_worker.rs:1474-1477 report_thrown's terminate check is less precise than flush_logs' outer guard

Annotations

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

See this annotation in the file changed.

@claude claude / Claude Code Review

report_thrown's terminate check is less precise than flush_logs' outer guard

The `report_thrown` closure gates on `self.has_requested_terminate()` alone, while the outer guard at :1470 was deliberately narrowed to `has_requested_terminate() && vm.jsc_vm().has_termination_request()` so the configure_defines self-signal (which sets only the Rust atomic, not the JSC trap) still dispatches. In that path the atomic is already true, so a genuine `JsError::Thrown` from `to_js`/`to_bun_string`/`dispatchError` would be silently dropped without `take_exception`. Consider matching