-
-
Notifications
You must be signed in to change notification settings - Fork 244
If one task crashes, others keep running #6
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
Comments
FYI - concurrently does this via a |
Thank you for the report. |
I reproduced this issue. But I wonder, I thought child processes are killed by OS when the parent process exited.... |
Yeah, I'm confused by that as well. I thought the child tasks would automatically get killed, but they don't. It might be worth looking at the source code for concurrently, since I've noticed that when I force-quit concurrently (via Ctrl+C), it does kill the child processes. Maybe it has something to do with how the processes are launched? |
I tried to send SIGTERM to remained tasks, but.... npm/npm#4603 :( |
|
It sucks that npm has that issue. I wonder how soon they plan to fix it? Thanks for looking into this. I appreciate it! |
refs #6 Because npm does not forward signals to child processes, I lookup child processes of npm, and kill them.
I published On this version, when Its test is here: https://github.com/mysticatea/npm-run-all/blob/v1.2.6/test/parallel.js#L36-58 Please try it! |
Awesome! Testing it right now.... |
Seems to work pretty well. It's not 100% perfect, but that's to be expected, given the hoops you're having to jump through. Thanks!!! |
got this issue again: If I hit CTRL + C it exits to fast - docker-compose does not stops containers but nextjs node server is stopped correctly "dev": "npm-run-all -l --race clean --parallel dev:docker dev:next",
"dev:docker": "docker-compose -f docker-compose-dev.yml up",
"dev:next": "next",
"clean": "rimraf .next",
|
When running multiple tasks simultaneously, if one task crashes, the others continue running, with no easy way to kill them. For example:
When I run
npm run runall
, it runswatch
andwebserver
in parallel. Let's say thatwatch
crashes for some reason (exits with a non-zero exit code). When this happens,npm-run-all
also exits. Butwebserver
is still running. If I re-runnpm run runall
, I now get an error because thewebserver
can't start because the already-running instance is blocking the port number.It would be nice if when one of the tasks crashes,
npm-run-all
would kill the other tasks too.The text was updated successfully, but these errors were encountered: