Skip to content

worker: survive terminate() while Bun.serve is streaming a type:"direct" body - #36342

Closed
robobun wants to merge 7 commits into
mainfrom
farm/8dfbc553/worker-terminate-direct-stream-defertermination
Closed

robobun wants to merge 7 commits into
mainfrom
farm/8dfbc553/worker-terminate-direct-stream-defertermination

make process.on('exit') skip check load-bearing by folding into mid-J…

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

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/runtime/server/RequestContext.rs:2690-2693 node:http sibling of on_response drain→then2 not guarded

Annotations

Check warning on line 2693 in src/runtime/server/RequestContext.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

node:http sibling of on_response drain→then2 not guarded

`on_node_http_request_with_upgrade_ctx` in `src/runtime/server/mod.rs` has the same `drain_microtasks()` → Pending → `then2` shape as `on_response` (mod.rs:1315 → 1358) but no `has_exception()` guard between them, so a `terminate()` landing inside that drain still trips `executeCallImpl`'s `assertNoException` in debug/ASAN. Per REVIEW.md's "fix the whole class" rule (already applied once on this PR to add the `on_response` guard), either add the same guard after mod.rs:1315 or note in the PR des