Skip to content

webcore(Blob): coalesce concurrent fd-backed blob reads onto a single ReadFile - #35832

Open
robobun wants to merge 13 commits into
mainfrom
farm/f3ee9036/stdin-concurrent-blob-read
Open

webcore(Blob): coalesce concurrent fd-backed blob reads onto a single ReadFile#35832
robobun wants to merge 13 commits into
mainfrom
farm/f3ee9036/stdin-concurrent-blob-read

review: restore swallowed-error why-comment; fix stale doc ref; de-fl…

af828fc
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 26, 2026 in 31m 23s

Code review found 1 potential issue

Found 2 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/blob/read_file.rs:459-468 IN_FLIGHT_FD_READERS keyed on Store alone: leading mismatched-window read blocks same-window siblings from coalescing

Annotations

Check warning on line 468 in src/runtime/webcore/blob/read_file.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

IN_FLIGHT_FD_READERS keyed on Store alone: leading mismatched-window read blocks same-window siblings from coalescing

Because `IN_FLIGHT_FD_READERS` is keyed on `*const Store` alone and `mark_in_flight` uses `.entry().or_insert_with()`, a leading mismatched-window read (e.g. `Bun.stdin.slice(0,3).bytes()`) occupies the Store's only slot for its lifetime, so two subsequent `Bun.stdin.arrayBuffer()` calls both fail the `(offset, max_length)` check against the sliced entry, both fall through to `create+schedule`, and race on fd 0 exactly as pre-PR. Not a regression (all three raced before), but keying the map on `