]> Cypherpunks repositories - gostls13.git/commit
os/exec: split parent I/O pipes by whether they are pumped by user code or internal...
authorBryan C. Mills <bcmills@google.com>
Sat, 23 Apr 2022 01:19:10 +0000 (21:19 -0400)
committerGopher Robot <gobot@golang.org>
Mon, 26 Sep 2022 17:26:59 +0000 (17:26 +0000)
commitbd8a5b00fcf71fb711ba8996a880b5b07f7b3634
treecad512abd760b40affd7a7dc934ca0e659c74568
parentb8d4a14a660827ea0331eb6cad99860bf5fdf66f
os/exec: split parent I/O pipes by whether they are pumped by user code or internal goroutines

The pipes pumped by goroutines can be closed as soon as their
respective goroutines are done.

The pipes pumped by user code, however, are documented to be closed in
Wait. When we add the WaitDelay field, it isn't obvious that we should
terminate the user-pumped pipes when the WaitDelay expires, since Wait
itself isn't going to wait for those user-controlled goroutines to
complete.

(It's a bit more complicated than that because the documentation
currently states that Wait must not be called while the pipes are
being read — but it isn't obvious to me that that advice is entirely
correct.)

For #50436.

Change-Id: I97909c91d2097fb75138a360747168c08609696d
Reviewed-on: https://go-review.googlesource.com/c/go/+/401894
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
src/os/exec/exec.go