You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is another version of #23019. In this case the child process is the shell and the grandchild process is the sleep. Killing the shell does not kill the sleep, so the parent waits for the grandchild to exit in order to complete collecting all output. Closing as duplicate.
The context doc describes "Calling the CancelFunc cancels the child and its children". Thinking of this in UNIX terminology (child == child process), the actual behavior (not killing the child process' children processes) is very misleading.
Please answer these questions before submitting your issue. Thanks!
exec.CommandContext is invalide
What version of Go are you using (
go version
)?go 1.10.1
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build487130894=/tmp/go-build -gno-record-gcc-switches"
What did you do?
https://play.golang.org/p/Ya4haCk5_P7
What did you expect to see?
exit context timeout 2 sec
What did you see instead?
exit
sleep 10
endThe text was updated successfully, but these errors were encountered: