-
Notifications
You must be signed in to change notification settings - Fork 9.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix cancellation when spawning a subprocess
If the shell spawns a subprocess which doesn't close the output file descriptors, the exec.Cmd will block on Wait() (see golang.org/issue/18874). Use an os.Pipe to provide the command with a real file descriptor so the exec package doesn't need to do the copy manually. This in turn may block our own reading goroutine, but we can select on that and leave it for cleanup later.
- Loading branch information
Showing
2 changed files
with
36 additions
and
27 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