stripe / subprocess

A port of Python's subprocess module to Ruby
MIT License
209 stars 17 forks source link

Fix a deadlock in #communicate #24

Closed nelhage-stripe closed 7 years ago

nelhage-stripe commented 7 years ago

If you call #communicate on a process with no open pipes, and the process exits before we enter the catching_sigchld block, we would deadlock forever waiting on a SIGCHLD that would never arrive.

Arguably calling #communicate on a process with no open pipes should be an error, but it's arguably useful as a synonym for #wait if you don't know whether or not there's output, and I'm wary of breaking clients.

r? @evan-stripe cc @andrew-stripe

evan-stripe commented 7 years ago

LGTM