Skip to content

fetch: abort the request when the response body reader is cancelled - #33231

Merged
Jarred-Sumner merged 10 commits into
mainfrom
farm/469333cb/fetch-reader-cancel-abort
Jul 4, 2026
Merged

fetch: abort the request when the response body reader is cancelled#33231
Jarred-Sumner merged 10 commits into
mainfrom
farm/469333cb/fetch-reader-cancel-abort

fetch: abort unconditionally on reader.cancel(), dropping the has_mor…

c2917fc
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 2, 2026 in 22m 23s

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/webcore/fetch/FetchTasklet.rs:1610-1612 Comment misdescribes abort_task() as only touching atomics + schedule_shutdown

Annotations

Check warning on line 1612 in src/runtime/webcore/fetch/FetchTasklet.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

Comment misdescribes abort_task() as only touching atomics + schedule_shutdown

The "only touches atomics + schedule_shutdown" clause is inaccurate — `abort_task()` also calls `self.tracker.did_cancel(&self.global_this)` (line 2259), which touches JSC. That's precisely why `abort_task()` can't be called from `on_response_finalize` during sweep (per the resolved thread at :1772), so a reader trusting this comment could wrongly conclude it's finalizer-safe. Suggest dropping the clause or rewording to "idempotent and does not touch `self.result`, so no mutex is needed".