Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

transport/file: avoid race with Command.Wait, fixes #463 #464

Merged
merged 2 commits into from
Jul 7, 2017
Merged

transport/file: avoid race with Command.Wait, fixes #463 #464

merged 2 commits into from
Jul 7, 2017

Conversation

smola
Copy link
Collaborator

@smola smola commented Jul 7, 2017

Pipe returned by Command.StderrPipe() has a race with Read and
Command.Wait(). We use a io.Pipe() instead and ensure it is closed
after Wait().

smola added 2 commits July 7, 2017 10:26
We only use the first line of error output. So we use a channel with
a single byte buffer and read the first line from stderr. Further
output is discarded, as well as any further I/O error, which might
be expected when closing the pipe (command finished).
Pipe returned by Command.StderrPipe() has a race with Read and
Command.Wait(). We use a io.Pipe() instead and ensure it is closed
after Wait().
@smola smola requested a review from mcuadros July 7, 2017 09:14
@mcuadros mcuadros merged commit 6b69a16 into src-d:master Jul 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants