Bun.write: poll instead of spin when a nonblocking stdout pipe returns EAGAIN - #35953
Open
robobun wants to merge 6 commits into
Open
Bun.write: poll instead of spin when a nonblocking stdout pipe returns EAGAIN#35953robobun wants to merge 6 commits into
robobun wants to merge 6 commits into
Claude / Claude Code Review
completed
Jul 26, 2026 in 23m 34s
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/blob/write_file.rs:467-477 |
Dup can land on fd 0/1/2 and be skipped by do_close's stdio_tag() guard |
Annotations
Check warning on line 477 in src/runtime/webcore/blob/write_file.rs
claude / Claude Code Review
Dup can land on fd 0/1/2 and be skipped by do_close's stdio_tag() guard
Minor edge case: `bun_sys::dup(fd)` lowers to `fcntl(F_DUPFD_CLOEXEC, 0)` (src/sys/lib.rs:2578), so if a stdio slot happens to be closed the dup can land on 0/1/2 — the new `is_allowed_to_close()` Fd arm returns true, but `FileCloser::do_close` (Blob.rs:7229) then vetoes the close via `opened_fd().stdio_tag().is_none()`, so that one dup is kept open. Impact is bounded (≤ one fd per free stdio slot, since the kept dup fills the slot and later dups return ≥3) and the trigger requires a stdio fd to
Loading