pnpm: Unexpected SIGTERM handling
pnpm version: 5.2.6
Code to reproduce the issue:
// sigterm.js
process.on('SIGTERM', (...args) => {
console.log(...args);
setTimeout(process.exit, 5000, 123);
});
setInterval(console.log, 1000, 1);
// package.json
...
"script": {
"sigterm": "node sigterm.js"
}
...
pnpm run sigterm
- in another tty
kill -TERM <pid_of_pnpm_run_sigterm>
Expected behavior:
pnpm run sigterm
upon receiving SIGTERM should pass the signal to child and wait for it to exit, pass 123 exit code to parent.
Actual behavior:
pnpm run sigterm
upon receiving SIGTERM passes signal to child, but does not wait for it to exit, hence child’s exit code is lost (and child is potentially running detached?).
Additional information:
- npm handles it flawlessly
- yarn has similar issue open for almost 3yrs now, don’t be like yarn
EDIT:
- change 666 to 123 because it’s capped at 154
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 10
- Comments: 19 (7 by maintainers)
Expected ^
Not expected ^
@zkochan appears to remain an issue
Hope you are safe.
Yes, it was fixed in v7.18.0
I did add it to a priority list but I have too much to do. And it is pretty hard for me to concentrate now, since I am in Ukraine.
I am OK to accept a contribution that makes it work the same way as it works in npm.
The issue is probably in this package: https://github.com/pnpm/npm-lifecycle