stdin: apply highwater backpressure to the pipe FileReader source - #35977
Merged
Claude / Claude Code Review
completed
Jul 26, 2026 in 33m 33s
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/FileReader.rs:962-964 |
on_pull watch() issues a redundant epoll_ctl/kevent per chunk |
Annotations
Check warning on line 964 in src/runtime/webcore/FileReader.rs
claude / Claude Code Review
on_pull watch() issues a redundant epoll_ctl/kevent per chunk
The unconditional `watch()` here re-arms the poll on every pending pull, but in the common streaming case (`for await` / `reader.read()` over a pipe or socket) the read loop's own `register_poll()` already re-arms it — `register_with_fd` does not short-circuit when already armed, so this adds one redundant `epoll_ctl(CTL_MOD)`/`kevent64` per delivered chunk. The re-arm is only actually needed when `NeedsRearm` is still set (i.e. after the new backstop early-return); gating on the poll's arm stat
Loading