Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not hang in communicate if spawned process forks
Currently we only exit the `communicate` loop when we get an EOF from stdout and stderr. If the child process forks before exiting, the fork will inherit those file descriptors and `communicate` will hang until the child exits. I believe it's preferable to drain stdout/stderr after the process exits and then break out of the `communicate` loop. Note that Open3 similarly hangs waiting for EOF. There is a risk that existing software depends on this behavior and that output could be non-deterministic if the forked grandchild is writing to stdout/stderr.
- Loading branch information
1 parent
7993e0e
commit cb14315
Showing
3 changed files
with
22 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Subprocess | ||
VERSION = '1.5.2' | ||
VERSION = '1.5.3' | ||
end |
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