Skip to content

Bun.write: poll instead of spin when a nonblocking stdout pipe returns EAGAIN - #35953

Open
robobun wants to merge 6 commits into
mainfrom
farm/4588fdfb/bun-write-stdout-eagain-spin
Open

Bun.write: poll instead of spin when a nonblocking stdout pipe returns EAGAIN#35953
robobun wants to merge 6 commits into
mainfrom
farm/4588fdfb/bun-write-stdout-eagain-spin

Bun.write: poll instead of spin when a caller-supplied fd returns EAGAIN

1d6373d
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 26, 2026 in 16m 57s

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/webcore/blob/write_file.rs:341-359 Sibling stale-result loop in ReadFile::do_read left unfixed

Annotations

Check warning on line 359 in src/runtime/webcore/blob/write_file.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

Sibling stale-result loop in ReadFile::do_read left unfixed

The read-side twin `ReadFile::do_read` (read_file.rs:510-556) has the byte-for-byte identical stale-result loop this PR just removed here: `result` is computed once, then `loop { match &result { ... } }` with an `io::RETRY && !could_block => continue` arm that re-matches the cached error forever without re-issuing the syscall. Per the repo's "fix the whole class" rule it's worth applying the same three-line reshaping (drop the loop; on RETRY set `could_block = true` and `wait_for_readable()`). T