-
Notifications
You must be signed in to change notification settings - Fork 2k
[CS2] CLI: Propagate SIGINT and SIGTERM signals when node is forked #4625
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
Conversation
Please retarget this against |
src/command.coffee
Outdated
@@ -444,6 +444,9 @@ forkNode = -> | |||
cwd: process.cwd() | |||
env: process.env | |||
stdio: [0, 1, 2] | |||
['SIGINT', 'SIGTERM'].forEach (signal) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our preferred style is to use for…in
:
for signal in ['SIGINT', 'SIGTERM']
This compiles into a traditional for
loop, without a new function or scope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought so looking at the surrounding code but in this case the new scope is necessary for the code to work properly.
Anyway I retargeted against 2
and used for...in
with do
for the scope.
76b1132
to
967c860
Compare
…ashkenas#4625) * Propagate SIGINT and SIGTERM signals when node is forked * Use for loop for consistency
When running commands like
coffee --nodejs --max_old_space_size=128 index.coffee
the coffee process doesn't forward signals to node process, which was already discussed in #4185.Problem is that tools that use flow SIGTERM, delay, SIGKILL leave zombie processes.
This fixes #4185.