Closed
Description
I've now twice been bitten by a bug around withProcess:
- Use withProcess
- Stream data from child process
- Done
Problem: this creates a really subtle race condition where the child process may close its output handles and, before actually exiting, the parent process will hit closeProcess
and then send a SIGTERM to the child.
The real problem is that withProcess
is confusing in how it behaves. I propose instead having two new functions:
withProcessTerm
, with the current behaviorwithProcessWait
, which will never send a SIGTERM, but instead wait for the child process to exit
Adding a deprecation message referring to these two new functions would have prevented a lot of head scratching in the two cases above.
Metadata
Metadata
Assignees
Labels
No labels