]> Cypherpunks repositories - gostls13.git/commit
os/exec: document blocking Stdin/Stdout/Stderr
authorIan Lance Taylor <iant@golang.org>
Tue, 27 Jan 2026 04:03:30 +0000 (20:03 -0800)
committerGopher Robot <gobot@golang.org>
Tue, 27 Jan 2026 20:28:35 +0000 (12:28 -0800)
commit251f3aa6ee6fc3925fe8e64cd4b403bfa73b93ab
treece977406cbce28ef542bba0d27a33407ec11012f
parent5ec5fdc093979c55c9605931d668e209cc1e1b00
os/exec: document blocking Stdin/Stdout/Stderr

WaitDelay only handles writes to Stdin and reads from Stdout/Stderr.
If Stdin is set to a blocking Reader, or Stdout/Stderr are set to
a blocking Writer, Wait can hang indefinitely. I don't see any way to
fix this with the current API, as there is no general way that the
os/exec package can interrupt the blocking Read or Write.

This CL documents the limitation and points people toward the
workaround of using StdinPipe/StdoutPipe/StderrPipe and arranging
for their own way to interrupt the blocking Read or Write.

Fixes #77227

Change-Id: I3150ae7af89dccf8d859b41eb43eaf0bbbb55fee
Reviewed-on: https://go-review.googlesource.com/c/go/+/739422
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Sean Liao <sean@liao.dev>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
src/os/exec/exec.go