Skip to content

fetch: encode FetchTasklet's cross-thread ownership in the type system - #31745

Open
alii wants to merge 20 commits into
mainfrom
ali/fetch-lifetime-clarity
Open

fetch: encode FetchTasklet's cross-thread ownership in the type system#31745
alii wants to merge 20 commits into
mainfrom
ali/fetch-lifetime-clarity

test: drop stale ASAN stderr filter in fetch-exit-in-flight

2ceb902
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jun 4, 2026 in 34m 59s

Code review found 1 potential issue

Found 4 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/dispatch.rs:1193-1196 CAS-lost final-callback path also leaks sink/drain refs at shutdown

Annotations

Check warning on line 1196 in src/runtime/dispatch.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

CAS-lost final-callback path also leaks sink/drain refs at shutdown

🟡 Follow-up to the comment at HTTPThread.rs:1082: the CAS-lost early return in `FetchTasklet::callback` (FetchTasklet.rs:2578–2585) returns *before* the `is_shutting_down()` check at 2588, so patching only the `is_done` block at 2608 leaves that path leaking the same sink/drain refs. A more robust single-point fix is to balance `sink_ref_held` / `queued_drain_tasks` here in `__bun_release_task_at_shutdown`'s FetchTasklet arm before `release_js_ref` (and have `release_at_shutdown` clear those fla