stripe / subprocess

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

Make the global self-read pipe `fork`-safe #38

Closed nelhage-stripe closed 7 years ago

nelhage-stripe commented 7 years ago

If we fork, it's important that the child and parent don't share a self-read pipe, since if they do, they risk stealing each others' events.

Check the PID and re-create the pipe if it's changed. This is theoretically subject to PID-wraparound issues, but should work well enough.

r? @andrew-stripe

nelhage-stripe commented 7 years ago

This has passed four runs of the full pay-server CI suite now on a branch.

andrew-stripe commented 7 years ago

:+1:

Can you add a comment about why we're doing the PID check?