Skip to content

worker: guard the remaining NewSocket / ServerWebSocket / Bun.serve / Bun.$ dispatch sites against a pending termination - #36808

Open
robobun wants to merge 9 commits into
mainfrom
farm/a8e86549/worker-terminate-guards-round-2
Open

worker: guard the remaining NewSocket / ServerWebSocket / Bun.serve / Bun.$ dispatch sites against a pending termination#36808
robobun wants to merge 9 commits into
mainfrom
farm/a8e86549/worker-terminate-guards-round-2

socket/server: sweep the remaining is_shutting_down() JS-entry gates

801fd3a
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Aug 3, 2026 in 20m 50s

Code review found 1 important issue

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

Details

Severity Count
🔴 Important 1
🟡 Nit 2
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/runtime/server/mod.rs:557-560 Stale doc comments on js_value_for_dispatch() after adding the script_execution_status gate

Annotations

Check warning on line 560 in src/runtime/server/mod.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

Stale doc comments on js_value_for_dispatch() after adding the script_execution_status gate

nit: 801fd3a added a `script_execution_status() != Running` → `None` branch here, but the doc comment immediately above (lines 552-556) still describes the contract as "or `None` once `finalize()` has set `Finalized` … only `Finalized` means the slots are gone" — implying that's the sole `None` trigger. The comment at mod.rs:1771 is more clearly stale: "the `js_value_for_dispatch` gate only trips once the wrapper is actually finalized" is now false. Comment-only, no runtime effect.