There is no guarantee that a OS process spawning fly proxy ... will terminate it, however the stdin is always closed when the parent terminates. In order to avoid zombie processes, we can watch stdin and when it gets closed we terminate the program. The original motivation is spawning fly proxy from Erlang VM.
There is no guarantee that a OS process spawning
fly proxy ...
will terminate it, however the stdin is always closed when the parent terminates. In order to avoid zombie processes, we can watch stdin and when it gets closed we terminate the program. The original motivation is spawning fly proxy from Erlang VM.For more context see a similar PR on esbuild: https://github.com/evanw/esbuild/pull/1449.