Skip to content

fix(reporter): wait and retry when task output forwarding hits EAGAIN - #801

Open
naokihaba wants to merge 7 commits into
voidzero-dev:mainfrom
naokihaba:fix/retry-wouldblock-task-output
Open

naokihaba wants to merge 7 commits into
voidzero-dev:mainfrom
naokihaba:fix/retry-wouldblock-task-output

Conversation

@naokihaba

Copy link
Copy Markdown
Contributor

Context

Reproduced on Vite+ v1.0.0 via https://github.com/naokihaba/vp-eagain-repro .

This happens when running two tasks concurrently while vp run outputs to a pipe, such as in CI logging.

Task A ──[Pipe ①]──→ vp ──→ vp's fd 1 ──[Pipe ②]──→ CI log collection
                                  ↑
Task B (Node) ────────────────────┘ Sharing the same output destination
  1. Task B (Node) sets the shared output to O_NONBLOCK, also making vp's fd 1 non-blocking.
  2. Task A outputs heavy logs, which vp writes to Pipe ②.
  3. Pipe ②'s buffer fills up instantly.
  4. vp's write returns EAGAIN instead of waiting.
  5. vp treats this as fatal and kills all tasks.

This fix only affects cases where write or flush returns WouldBlock. Outputs to terminals, files, or blocking pipes never trigger WouldBlock, keeping the previous behavior unchanged. Common errors like reader disconnections are still returned as before.

@naokihaba
naokihaba marked this pull request as ready for review October 4, 2026 14:23
@fengmk2
fengmk2 requested a review from wan9chi October 5, 2026 09:12

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vp run: output forwarding fails with EAGAIN when an inherited Node child sets stdout non-blocking

1 participant