veyron/services/mgmt/node/impl: fix data race around stdoutpipe
The issue was introduced back in http://go/vcl/5902, when Cos wanted a more
robust way to interleave stdout from the child and the parent node
managers. However, as explained in
http://golang.org/pkg/os/exec/#Cmd.StdoutPipe, it is incorrect to try to call
Wait on the cmd while reads on the pipe are still in progress.
The fix we're going with is to just dump stdout of the child to a log file
instead of using a pipe (the same as what we do for stderr). We could then
choose to transcribe the contents of the stdout file to the parent's os.Stdout,
but instead we decided to dump everything to vlog. I don't see a reason to merge
the child's stdout with the parent's anymore, and this also simplifies the test
logic in impl_test, where we're now receiving and dealing with stdout output
from the parent only.
This fixes a long-standing jenkins veyron-go-race failure cause, most recently
reported as http://go/vissues/386.
Change-Id: I5d223db822a4132e0c0cae78a3ca3b9b4c957a60
2 files changed