-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid race-conditions while executing sub-commands (#1201)
## Changes `executor.Exec` now uses `cmd.CombinedOutput`. Previous implementation was hanging on my windows VM during `bundle deploy` on the `ReadAll(MultiReader(stdout, stderr))` line. The problem is related to the fact the MultiReader reads sequentially, and the `stdout` is the first in line. Even simple `io.ReadAll(stdout)` hangs on me, as it seems like the command that we spawn (python wheel build) waits for the error stream to be finished before closing stdout on its own side? Reading `stderr` (or `out`) in a separate go-routine fixes the deadlock, but `cmd.CombinedOutput` feels like a simpler solution. Also noticed that Exec was not removing `scriptFile` after itself, fixed that too. ## Tests Unit tests and manually
- Loading branch information
Showing
2 changed files
with
28 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters