When a native capture helper exits, `exec.Cmd.Wait` closes a `StdoutPipe` even if the stream consumer has not finished reading buffered output. The full v2.6.3 regression exposed this as `file already closed` in place of EOF. The same ordering can discard the final frame. Give the existing Stream its own `os.Pipe` read end. The child owns the writer after startup, and Stream closes the reader only after its existing shutdown drain completes. Process waiting and typed error reporting keep their current owners; no retry, new state machine or relaxed assertion is added. Validation: Go 1.27.4, rebuilt nativecapture and nativehost package tests passed from stable local binary paths. The new deterministic regression waits for the helper to exit before reading its buffered frame and EOF; existing process-cause, cancellation and backpressure tests remain unchanged. The 3.0 Rust capture path already transfers stdout to its reader task and joins it before retirement, so it needs no matching change. This repairs the remaining full-check failure before the approved v2.6.3 publication. No packages from earlier attempts were published. ## Release notes ### Capture reliability / 采集稳定性 - Preserve buffered capture output when the native helper exits, so closing the process cannot discard its final frame or replace the original failure with a closed-pipe error. - 保留原生采集进程退出时尚未读取的数据,避免提前关闭管道丢失尾帧,或将原始失败变成“管道已关闭”。
609d1e0768
·
2026-11-12 23:28:05 -04:00
History