-
Notifications
You must be signed in to change notification settings - Fork 30k
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
cluster: send suicide message on disconnect #3720
Conversation
Ok with the idea. Using the term |
|
Yeah, I was just looking at that. That's unfortunate but ok. |
Technically, this changes behavior, but it brings it back into line with what is documented (see #3238). I would say it is semver-patch. |
@jasnell suicide is definitely problematic... so is Master / Worker and a handful of other Nouns / Verbs throughout the codebase. As mentioned, changing any of those would be an obvious semver major... it would also require a lot of churn in the ecosystem. That being said, I think that the benefits to our ethics / ethos / community outweighs the potential technical debt. If people are open to it we can open an issue to discuss this further. |
we could alias 'suicide' to another word in the codebase to maintain reverse compatibility while moving to the new word and updating the docs. then it's a feature rather than compat break and stays semver-minor. |
Yep. I had just forgotten that the term was already in use. I'm painfully aware of the various unfortunate other uses I just didn't want us to add another. I'm +1 on @mikeal's proposal. |
|
||
worker.on('exit', function() { | ||
assert.strictEqual(worker.suicide, true); | ||
}); |
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.
Can you wrap the event listeners in common.mustCall(...)
?
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.
Aside: perhaps it's a good idea to check the order of events as well?
@cjihrig ... ah, ok, so this is a regression fix. Grr... ok. Agree with semver-patch then. I would recommend expanding the description in the commit message to describe the regression. |
This commit causes Worker.prototype.disconnect() to send a suicide message to the cluster master. The function is also restructured to eliminate redundant code. Fixes: nodejs#3238
Updated with @bnoordhuis comments. |
LGTM. Applicable for LTS? (assuming yes) |
I'd say yes. The documentation is incorrect without this change. |
Landed in f299d87. @evanlucas you may need to update your |
Will do. Thanks for the heads up |
landed in v4.x-staging in e86817c |
This commit causes
Worker.prototype.disconnect()
to send a suicide message to the cluster master. The function is also restructured to eliminate redundant code.Fixes: #3238