GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(cli): handle stdout backpressure by hyoban · Pull Request #2169 · voidzero-dev/vite-plus

Conversation

@hyoban

@hyoban hyoban commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • retry partial stdout writes when a non-blocking output stream applies backpressure
  • wait for Unix file descriptors with poll(POLLOUT) and propagate non-retryable I/O errors
  • make vp check output helpers return write failures instead of discarding them or panicking
  • cover short writes, WouldBlock, interrupted writes, terminal errors, and a real non-blocking Unix stream

Root cause

vp check captures Oxlint diagnostics and replays them to stdout. When a consumer could not drain a non-blocking stdout pipe quickly enough, write_all returned WouldBlock. The diagnostic replay path discarded that error, so the diagnostics were truncated and a later standard-library print could panic while stdout was still unavailable.

The new write loop preserves the unwritten suffix, waits until the stream is writable, and retries. Permanent failures are returned through the existing command result path.

Fixes #2165.

Validation

  • cargo test -p vite_shared waits_until_a_nonblocking_writer_is_ready_before_retrying
  • just check
  • just lint
  • just test
  • pnpm -F vite-plus build
  • just snapshot-test check_ (36 passed)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot] reacted with thumbs up emoji jong-kyung reacted with heart emoji liangmiQwQ reacted with rocket emoji
All reactions
  • 👍 1 reaction
  • ❤️ 1 reaction
  • 🚀 1 reaction
hyoban added 3 commits July 14, 2026 10:12
@hyoban
fix(cli): handle stdout backpressure
2bc7e1e
@hyoban
fix(cli): harden stdout backpressure
227560d
@hyoban
test(cli): simplify stdout backpressure coverage
4757281
@netlify

netlify Bot commented Jul 14, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

✅ Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit fa6a005
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a56058048c7fb00080b3d53
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hyoban
test(cli): gate Unix-only stdout test import
1458b01
@hyoban

hyoban commented Jul 14, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

CI update:

The Linux/macOS failures are unrelated snapshot drift: a run-day install date (already addressed by #2150) and newer package versions resolved from the registry.

This PR does not touch those paths, so I have not included unrelated snapshot updates here.

liangmiQwQ reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hyoban
hyoban marked this pull request as ready for review July 14, 2026 02:42
@hyoban

hyoban commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 1458b01027

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@liangmiQwQ
liangmiQwQ requested a review from cpojer July 14, 2026 05:00
@cpojer
cpojer requested review from jong-kyung and wan9chi and removed request for cpojer July 14, 2026 05:08
jong-kyung
jong-kyung approved these changes Jul 14, 2026
View reviewed changes

@jong-kyung jong-kyung left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 😁

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hyoban reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@jong-kyung
jong-kyung requested a review from liangmiQwQ July 14, 2026 06:08
liangmiQwQ
liangmiQwQ approved these changes Jul 14, 2026
View reviewed changes

@liangmiQwQ liangmiQwQ left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hyoban reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@wan9chi
Merge branch 'main' into 0714-stdout-backpressure
fa6a005
@wan9chi wan9chi mentioned this pull request Jul 15, 2026
fix(cli): ensure blocking stdio #2173
Merged
@wan9chi

wan9chi commented Jul 15, 2026

Copy link
Copy Markdown
Member

Thank you for tracking this down and putting together a fix! This PR correctly identifies the underlying issue.

However the same problem can affect any code that writes to stdout or stderr in the Vite+ process, including vp check and vite-task. Because vite-task is a Cargo dependency, we cannot patch its write sites in this repository. Building on your findings, I’m fixing it in a more general way in #2173 to cover all writers.

jong-kyung, hyoban, and liangmiQwQ reacted with heart emoji
All reactions
  • ❤️ 3 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@wan9chi wan9chi closed this Jul 15, 2026
graphite-app Bot pushed a commit that referenced this pull request Jul 15, 2026
@wan9chi
fix(cli): ensure blocking stdio (#2173)
c8d1e91
Fixes #2165.

## Root cause

Node marks non-TTY stdio as non-blocking, and the flag is shared with inherited child descriptors. Rust's standard I/O and embedded dependencies assume blocking writes, so a full consumer pipe can return `EAGAIN`, truncate diagnostics, or panic.

## Why this approach

#2169 retries writes in code we control. Dependencies like vite-task write directly to the same stdio, so those retries cannot protect them. Clearing `O_NONBLOCK` at startup covers every writer.
wan9chi added a commit that referenced this pull request Jul 15, 2026
@wan9chi
fix(cli): ensure blocking stdio (#2173)
103b30f
Fixes #2165.

## Root cause

Node marks non-TTY stdio as non-blocking, and the flag is shared with inherited child descriptors. Rust's standard I/O and embedded dependencies assume blocking writes, so a full consumer pipe can return `EAGAIN`, truncate diagnostics, or panic.

## Why this approach

#2169 retries writes in code we control. Dependencies like vite-task write directly to the same stdio, so those retries cannot protect them. Clearing `O_NONBLOCK` at startup covers every writer.
@korya korya mentioned this pull request Sep 25, 2026
vp run: task output forwarding aborts with EAGAIN when stdout turns non-blocking mid-run (follow-up to #2165) #2824
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@wan9chi wan9chi Awaiting requested review from wan9chi
2 more reviewers
@jong-kyung jong-kyung jong-kyung approved these changes
@liangmiQwQ liangmiQwQ liangmiQwQ approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

vp check panics on EAGAIN while replaying large lint diagnostics

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@hyoban @wan9chi @jong-kyung @liangmiQwQ
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.