Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate withProcess #25

Closed
snoyberg opened this issue Jun 24, 2019 · 0 comments
Closed

Deprecate withProcess #25

snoyberg opened this issue Jun 24, 2019 · 0 comments

Comments

@snoyberg
Copy link
Member

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 behavior
  • withProcessWait, 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.

snoyberg added a commit that referenced this issue Jun 26, 2019
Deprecate withProcess/withProcess_ (fixes #25)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant