atom-runner
atom-runner copied to clipboard
Use tree-kill to properly stop the whole process tree
ChildProcess.kill() doesn't stop forked subprocesses. This commit uses tree-kill to properly handle forked subprocesses on all platforms.
Shouldn't the OS be reaping subprocesses? Can you show a scenario where the forked subprocesses remain around as zombies?
Hi @lsegal,
yes, there are plenty of situations where subprocesses won't get killed by child_process. The ones I am struggling with are more complex python scripts using asyncio. A simple one would be a basic go server like this.
package main
import (
"net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Hello World!"))
}
func main() {
http.HandleFunc("/", handler)
http.ListenAndServe(":8080", nil)
}