Make sure we wait for stdout/stderr pipes to be closed before calling Wait()#299
Make sure we wait for stdout/stderr pipes to be closed before calling Wait()#299tomhjp merged 1 commit intohashicorp:mainfrom
Conversation
|
Hi @tomhjp! Could you take a look at these changes whenever you have a chance? Thank you!! |
|
Thanks for the PR and the ping! I'd like to get a test for this fix, please could you share details on a repro? I can reliably repro if similarly to the previous issue I add a |
|
I pushed a test that fails before this fix and passes after in 36c021d. LMK if you think that looks like a good test case. |
|
Thank you @tomhjp for the test! I appreciate it a lot. We were encountering these logs "sometimes" in our error reports so it was just noise. |
tomhjp
left a comment
There was a problem hiding this comment.
Awesome, thanks for the confirmation! In that case I'm convinced we've understood the bug sufficiently well to merge. I'll add the test in a follow up PR. Thanks again for the fix!
…#299) If the two goroutines are left to race each other, when runner.Wait() wins it will close the file and cause the stdout scanner to log a spurious os.ErrClosed error instead of returning nil after encountering an io.EOF error.
Fixes #298