Repository navigation
fix(executor): keep pipelines concurrent with fd-2 redirects (Refs #3516) - #3509
Conversation
|
Thanks for the PR, @Catapult291. Captured: the Per the repo rule, external PRs go through captain review first, so this is queued for that review — no merge from this side, and I am not requesting any change here. CI status, checked just now: 3 legs are red — Rust tests, Rust tests (macOS), and GNU regression goldens and canaries — and all three fail on the same single test, |
|
Quick note on the 3 red CI legs ( For reference: the PR body's |
|
【WIN-AGENT-AUDIT】s10 lane — 建议:PENDING(CONFLICTING,跳过不合) head: 8248fbe base(merge-base): 8b48c16 文件: 3 个 +474/-50 处置:不合并。 背景提示:
腿:本轮全部未跑(按 CONFLICTING 跳过规则),不记为通过。 未跑/VOID 的腿:
|
|
【WIN-AGENT-AUDIT】PR #3509 第2轮 — 建议:PENDING(CONFLICTING,产品语义冲突,需队长定序) V 波收网复核:
|
评审结论:FAIL(需 rebase,本侧无法代改)跨仓库 fork( 功能本身:正确,且 master 仍缺在 PR 自身 base( WSL GNU Bash 5.3.20 脚本文件实测(oracle):
→ 不是被 master 取代,是真实未修 bug(无限生产者 + fd-2 redirect 的 shell-side tail)。 阻断点(冲突实质,非机械文本冲突)
建议
状态:未合并,PR 保持 OPEN;本备注只作评审记录,不关闭任何 issue。 |
An infinite producer plus a stderr redirect on any pipeline member fell back to the sequential stage loop, which materializes the producer to EOF before starting the consumer: `yes | head -3 2>/dev/null` never returned. - Admit fd-2 redirects in the concurrent pipeline probes (all-external, shell-writer, external-prefix); `2>&-` still takes the sequential path because Stdio cannot express a closed fd. - Wire an intermediate member's resolved fd-2 target onto its child stderr (null, file/append, shared fd, or a duplicate of the outgoing pipe for `2>&1`), preserving true merged write order. - Route the final member's captured stderr through the same ordered walk as stdout, covering `2>file`, `2>&1`, `>file 2>&1` and `2>&1 >file`. - Add a watchdog-bounded regression test for the hang and PIPESTATUS.
Follow-up to the concurrent fd-2 wiring: an in-shell tail
(`yes | true 2>/dev/null`) and a single-command brace group
(`yes | { head -3; } 2>/dev/null`) still forced the sequential stage
loop, which drains an unbounded producer forever.
- Allow a streaming tail's own fd-2 redirect; the tail runs in-shell and
its captured stderr goes through write_concurrent_pipeline_output.
- Fold `{ cmd; } 2>dst` into `cmd 2>dst` during pipeline
normalization (GNU runs the compound's redirects before the body),
so the concurrent drivers can admit the member.
8248fbe to
9b452e7
Compare
|
Rebased onto current master (
验证: |
|
CI 归因(run 44071755856,head |
Resolve pipeline_exec.rs against #3509 (member-own 2> redirects via configure_stage_stderr/stage_has_stderr_redirect) and #3860 (#3566 prefix stdout): wire() lays the ambient fd-table default first, then configure_stage_stderr applies the member's own redirect (the do_piping -> do_redirections order); Piped drains keep the child.stderr.take() guard; spawn-failure diagnostics ride write_default_stderr like the unix twin.
Fixes the
yes | head -3 2>/dev/nullclass of hangs: any fd-2 redirect sent the pipeline down the sequential path, draining the unbounded producer.Opens fd-2 admission on the concurrent path, wires member stderr redirects onto the child stdio, and routes the final member's stderr through the existing stream router.
2>&-stays on the sequential path.tests/pipeline_stderr_redirect_streaming.rs(8 tests) pins the shapes;cargo test --lib1349 passed / 1 pre-existing failure (api::consumer_tests::issue2084, fails on master too).Refs #3516
本 PR 删除了什么
无文件/函数级删除。The −49 lines in
src/executor/pipeline_exec.rsare in-place rewires: the two blanket fd-2 admission rejections becomestage_closes_stderr, and the three duplicated inline final-member stderr publish blocks are consolidated into the sharedwrite_concurrent_pipeline_outputhelper, which routes through the existingroute_pipeline_stage_streams(one mechanism, not a second walk).src/executor/pipeline_stages.rsis a 1-line visibility widening; the pin file is pure addition.