Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
6 participants
@cjihrig
Copy link
Contributor

commented Nov 9, 2015

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

@jasnell

This comment has been minimized.

Copy link
Member

commented Nov 9, 2015

Ok with the idea. Using the term suicide likely isn't the best choice, however.

@cjihrig

This comment has been minimized.

Copy link
Contributor Author

commented Nov 9, 2015

suicide is an existing term, used throughout the code. Changing it would be a semver-major bump.

@jasnell

This comment has been minimized.

Copy link
Member

commented Nov 9, 2015

Yeah, I was just looking at that. That's unfortunate but ok.

@cjihrig

This comment has been minimized.

Copy link
Contributor Author

commented Nov 9, 2015

Technically, this changes behavior, but it brings it back into line with what is documented (see #3238). I would say it is semver-patch.

@MylesBorins

This comment has been minimized.

Copy link
Member

commented Nov 9, 2015

@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.

@mikeal

This comment has been minimized.

Copy link
Contributor

commented Nov 9, 2015

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.

@jasnell

This comment has been minimized.

Copy link
Member

commented Nov 9, 2015

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.

@bnoordhuis

View changes

test/parallel/test-regress-GH-3238.js Outdated

worker.on('exit', function() {
assert.strictEqual(worker.suicide, true);
});

This comment has been minimized.

Copy link
@bnoordhuis

bnoordhuis Nov 9, 2015

Member

Can you wrap the event listeners in common.mustCall(...)?

This comment has been minimized.

Copy link
@bnoordhuis

bnoordhuis Nov 9, 2015

Member

Aside: perhaps it's a good idea to check the order of events as well?

@jasnell

This comment has been minimized.

Copy link
Member

commented Nov 10, 2015

@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.

@jasnell jasnell removed the semver-minor label Nov 10, 2015

cluster: send suicide message on disconnect
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

@cjihrig cjihrig force-pushed the cjihrig:3238 branch to c0de81b Nov 10, 2015

@cjihrig

This comment has been minimized.

Copy link
Contributor Author

commented Nov 10, 2015

@jasnell

This comment has been minimized.

Copy link
Member

commented Nov 10, 2015

LGTM. Applicable for LTS? (assuming yes)

@cjihrig

This comment has been minimized.

Copy link
Contributor Author

commented Nov 10, 2015

I'd say yes. The documentation is incorrect without this change.

@cjihrig

This comment has been minimized.

Copy link
Contributor Author

commented Nov 11, 2015

cjihrig added a commit that referenced this pull request Nov 11, 2015

cluster: send suicide message on disconnect
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
PR-URL: #3720
Reviewed-By: James M Snell <jasnell@gmail.com>
@cjihrig

This comment has been minimized.

Copy link
Contributor Author

commented Nov 11, 2015

Landed in f299d87. @evanlucas you may need to update your suicide replacement PR accordingly.

@cjihrig cjihrig closed this Nov 11, 2015

@cjihrig cjihrig deleted the cjihrig:3238 branch Nov 11, 2015

cjihrig added a commit that referenced this pull request Nov 11, 2015

cluster: send suicide message on disconnect
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
PR-URL: #3720
Reviewed-By: James M Snell <jasnell@gmail.com>

@Fishrock123 Fishrock123 referenced this pull request Nov 11, 2015

Merged

Propose v5.1.0 #3736

@evanlucas

This comment has been minimized.

Copy link
Member

commented Nov 11, 2015

Will do. Thanks for the heads up

cjihrig added a commit that referenced this pull request Nov 17, 2015

cluster: send suicide message on disconnect
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
PR-URL: #3720
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins

This comment has been minimized.

Copy link
Member

commented Nov 17, 2015

landed in v4.x-staging in e86817c

@rvagg rvagg referenced this pull request Nov 17, 2015

Closed

v4.2.2+1 commit candidates #57

cjihrig added a commit that referenced this pull request Dec 4, 2015

cluster: send suicide message on disconnect
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
PR-URL: #3720
Reviewed-By: James M Snell <jasnell@gmail.com>

@jasnell jasnell referenced this pull request Dec 17, 2015

Closed

Release 4.2.4 Planning #4321

cjihrig added a commit that referenced this pull request Dec 17, 2015

cluster: send suicide message on disconnect
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
PR-URL: #3720
Reviewed-By: James M Snell <jasnell@gmail.com>

cjihrig added a commit that referenced this pull request Dec 23, 2015

cluster: send suicide message on disconnect
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
PR-URL: #3720
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.