Skip to content

Deprecate withProcess #25

Closed
Closed
@snoyberg

Description

@snoyberg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions