Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug that resulted in sporadic failed stream reassembly
The failure coincided with this error in the log: msg="Stream parser reported error: read |0: file already closed" The StdoutPipe docs explain the problem: https://pkg.go.dev/os/exec?utm_source=godoc#Cmd.StdoutPipe "Wait will close the pipe after seeing the command exit, so most callers need not close the pipe themselves. It is thus incorrect to call Wait before all reads from the pipe have completed. For the same reason, it is incorrect to call Run when using StdoutPipe. See the example for idiomatic usage." My bug was that I Wait()ed for the stream process to end in a goroutine while at the same time, I handed off the process's stdout to a parser to build the stream data structures. Depending on timing, I might call Wait() before the stream parser has finished reading the output - the problem described above.
- Loading branch information