Multiple processes exiting with code 0 or SIGTERM produce a non-zero exit code
See original GitHub issue4.1.0
This is my output. All the processes are exiting with 0 or SIGTERM. But the final exit code is non-zero.
[test ] npm run test:docker:sleep exited with code 0
--> Sending SIGTERM to other processes..
[server] [mock ] npm run start:mockserver:nobunyan exited with code SIGTERM
[server] [nes ] DOCKER=1 nessie start exited with code 0
[server] [webpack] npm run webpack:server exited with code 0
[server] npm ERR! code ELIFECYCLE
Here are my npm scripts:
"start:docker": "concurrently --n 'nes ,mock ,webpack' -s 'first' 'DOCKER=1 nessie start' 'npm run start:mockserver:nobunyan' 'npm run webpack:server'",
"test:docker:sleep": "sleep 10 && npm run --prefix functional-tests test:docker",
"test:functional:docker:ra": "npm-run-all --parallel -lr 'test:docker:sleep' 'start:docker'",
"test:functional:docker": "concurrently -n 'test ,server' -s 'first' --kill-others 'npm run test:docker:sleep' 'npm run start:docker' ",
test:functional:docker:ra
runs the same commands but exits with 0 (the desired output).
I need this exit code for my build pipeline.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:8
- Comments:13 (1 by maintainers)
Top Results From Across the Web
Exits with code 1 on SIGTERM without waiting for child #4667
The issue that this stemmed from was about handling SIGTERM events (#3424) and was introduced in pull request #3789.
Read more >A brand new website interface for an even better experience!
Multiple processes exiting with code 0 or SIGTERM produce a non-zero exit code.
Read more >Set exit code when receiving SIGTERM in Quarkus
I'd like to know how I can tell Quarkus to gracefully exit with code 0 upon receiving SIGTERM. I'd still like to react...
Read more >process termination - Make Linux Software
An exit code of zero indicates correct execution, while a nonzero exit code indicates that an error occurred. In the latter case, the...
Read more >Keep exit codes when trapping SIGINT and similar?
I solved it now by simply exiting with some error codes hardcoded and trapping EXIT. This might be problematic on certain systems because...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is very frustrating as it means I can’t use --kill-others in any reasonable way without making it erroneously think there is an error.
Although this would be a breaking change. I would definitely expect the exit code to be the one from the first process with
--kill-others
In that case I most likely don’t care about the other processes’ exit code since I decide to kill them before they are done.The most prominent use case is killing a (web) server when the tests you wanted to run on it are done. The exit code of the tests is definitely relevant, but the one from the server is not.