-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fix process not recycled properly on Windows #1727
Conversation
what should I do with that travis ci failure? I think it's not related to my change. |
Don't remove the |
@soyuka Thanks for the info. I opened an issue against Node (nodejs/node/issues/3617)for its not being consistent across platforms. Meanwhile, I provided this fix as a work around on Windows. |
@@ -242,7 +257,7 @@ module.exports = function(God) { | |||
if (mode.indexOf('cluster') === 0) | |||
treekill(parseInt(pid)); | |||
else | |||
process.kill(-(parseInt(pid)), 'SIGINT'); |
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.
Just for my knowledge, why the behaviors differ in terms of mode.indexOf('cluster') ? In other word, why couldn't we use treekill instead of process.kill(-pid)
everywhere?
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 think I explained this in #1036 (comment). Basically, cluster
doesn't accept a {detached: true}
option (like fork
) and causes it no to be attached to it's own child processes.
See also this test case : https://gist.github.com/soyuka/90378a78b317ecc7b2c3 (I could translate if you need me to)
#1036 feature introduction |
Could you please send this PR on development branch? Thanks! |
Fix process not recycled properly on Windows
@Unitech I wasn't familiar with the work flow. Looks like you've merged it directly into master. Do you still need me to send it to development branch? |
Yes I merged it and it's already available on the latest PM2 0.15.9 (published today) Thanks! |
Awesome. Thanks! |
This fixes #1664