Skip to content

fix: pipeline + while-read 卡死/爆内存 (#723) - #793

Merged
arookieofc merged 1 commit into
masterfrom
fix/723-pipeline-streaming-tail
Oct 18, 2026
Merged

arookieofc merged 1 commit into
masterfrom
fix/723-pipeline-streaming-tail

Conversation

@arookieofc

Copy link
Copy Markdown
Member

Closes #723

现象

yes | head -50 | while read l; do:; done 必现 hang 或 OOM(实测 RSS 涨到 5.4GB 被杀)。原报告者在其他场景 190+ 次 0 复现,但这个变体 100% 必现。

根因

不是 while-read 的缓冲问题,而是 #761 的修复(execute_external_prefix_streaming_tail 及其 3 个配套函数)在 Unix 上是 stub、根本没启用——多前缀 pipeline 的 tail 阶段没走流式路径。

改动

src/executor/pipeline_exec.rs 把 #[cfg(windows)] 放宽为 #[cfg(any(windows, unix))],并加 Unix fd 转换分支。最小修复,未重构顺序循环。

验证

修复后 5/5 瞬间输出 done;新回归测试 tests/issue723_streaming_tail_multi_prefix.rs 5/5;issue345 canary 5/5。

@github-actions

Copy link
Copy Markdown
Contributor

欢迎!这是你的第一个 PR 🎉 请确认已跑过本地测试套件;CI 通过后维护者会 review。

@arookieofc
arookieofc merged commit 7707192 into master Oct 18, 2026
8 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/723-pipeline-streaming-tail branch October 18, 2026 09:29
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.

[bug] pipeline with while-read consumer stalls

1 participant