Open hasezoey opened 2 years ago
shouldn't the handler for SIGINT contain the process.exit(0)
after the console.log
?
shouldn't the handler for SIGINT contain the
process.exit(0)
after theconsole.log
?
SIGINT (or SIGTERM) does not mean it needs to immediately exit unlike other events like beforeExit
and the problem is that yarn exists while still leaving the node process of the actual process orphaned on a SIGINT (and SIGTERM), unless those signals are directly send to the nodejs process via kill
, but SIGINT is sent to the yarn process when pushing CTRL+C on the console
I believe I have run into this issue as well. I have a Typescript server that when I run it directly with ts-node ./server/server
, when signaling SIGINT via Ctrl+C, my graceful shutdown code is run and exit code is 0 (can be checked by running echo $?
directly after exit).
This is the exact same script that I've put in my package.json
's "start", and when running yarn start
I can see it's running the same command. However, when I send SIGINT via Ctrl+C, exit code delivered to my console is 130.
Am also encountering this same aggravating issue; I'm hoping to find command line flag that could fix. Hope this is fixed soon
Also encountering this issue.
I have run into a weird issue where i want to listen on
SIGINT
and have confirmation that it should be closed (by pressing it again), but when run through yarn, it exits the yarn process but leaves the nodejs process behind.yarn package.json script:
test code:
Behavior in yarn: once pressing CTRL+C, then it logs
sigint
once, and drops me to the shell, but the nodejs process is still running and outputting things as seen by subsequentinterval
Behavior in plain node: always when pressing CTRL+C it will triggersigint
and does not drop me to the shellSystem: Node: 18.10.0 Yarn: 1.22.19 Linux 6.0.2 Manjaro