Repository navigation
fix(pipeline): stream last-stage host stdout live; keep capture/redirect collecting - #1445
Merged
caomengxuan666 merged 1 commit intoOct 24, 2026
Conversation
Contributor
|
Related: #1454. This PR fixes the buffering part (the last member's output now reaches the host live). The last member still gets a capture pipe as its stdout ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
A | Bbuffered the entire last-stage stdout and wrote it only after all members were reaped (~seconds for a 1-line/s producer).Changes
PipelineDrainTarget::{Collect,StreamHostStdout}: when the last stage's fd1 is direct host stdout, pump 16KB chunks live viawrite_real_stdout_uncaptured; first host write error is recorded but drain continues (avoid niubash#158-style deadlock).final_member_stdout_streams_to_host: any redirect, fd1 close, shell-writer capture,$(), or executor capture → Collect (unchanged semantics).tests/pipeline_streaming_regressions.rs.Related: #158, #761. Pair with WinuxCmd
catshort-read PR (MSVCxsgetnwas the second layer for| cat).Note:
bash -c '<pipeline>'shares this path because bash/sh are hardlinks to niu (niubash #397); no extra special case.Test plan
python lines.py | catfirst linebash -c '<pipeline>'$(python lines.py | cat)yes | head -3PIPESTATUS141 0Niubash defect log D4 (2026-10-23).