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: expose result of send() #6998

Merged
merged 1 commit into from
May 31, 2016
Merged

cluster: expose result of send() #6998

merged 1 commit into from
May 31, 2016

Conversation

cjihrig
Copy link
Contributor

@cjihrig cjihrig commented May 26, 2016

Checklist
  • tests and code linting passes
  • a test and/or benchmark is included
  • the commit message follows commit guidelines
Affected core subsystem(s)

cluster

Description of change

There are several places in the cluster module where a version of process.send() is called, but the result is swallowed. Most of these cases are internal, but Worker.prototype.send(), which is publicly documented, also suffers from this problem. This commit exposes the return value to facilitate better error handling, and bring Worker.prototype.send() into compliance with the documentation.

@nodejs-github-bot nodejs-github-bot added the cluster Issues and PRs related to the cluster subsystem. label May 26, 2016
@cjihrig
Copy link
Contributor Author

cjihrig commented May 26, 2016

Kind of refs: nodejs/node-v0.x-archive#8746

@jasnell
Copy link
Member

jasnell commented May 26, 2016

LGTM but semver-minor?

@cjihrig
Copy link
Contributor Author

cjihrig commented May 26, 2016

Definitely not semver-minor. The publicly exposed use is already documented as returning a Boolean, even though it doesn't prior to this commit. I'd say semver patch.

@jasnell
Copy link
Member

jasnell commented May 26, 2016

Ok, works for me

@ronkorving
Copy link
Contributor

LGTM

@cjihrig
Copy link
Contributor Author

cjihrig commented May 27, 2016

CI: https://ci.nodejs.org/job/node-test-pull-request/2818/

EDIT: A few EADDRINUSE failures. Double checking with another run: https://ci.nodejs.org/job/node-test-pull-request/2819/

@bnoordhuis
Copy link
Member

LGTM

@cjihrig
Copy link
Contributor Author

cjihrig commented May 28, 2016

There are several places in the cluster module where a version
of process.send() is called, but the result is swallowed. Most
of these cases are internal, but Worker.prototype.send(), which
is publicly documented, also suffers from this problem. This
commit exposes the return value to facilitate better error
handling, and bring Worker.prototype.send() into compliance
with the documentation.

PR-URL: nodejs#6998
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ron Korving <ron@ronkorving.nl>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@cjihrig cjihrig merged commit 67368d8 into nodejs:master May 31, 2016
@cjihrig cjihrig deleted the send branch May 31, 2016 13:55
Fishrock123 pushed a commit that referenced this pull request Jun 1, 2016
There are several places in the cluster module where a version
of process.send() is called, but the result is swallowed. Most
of these cases are internal, but Worker.prototype.send(), which
is publicly documented, also suffers from this problem. This
commit exposes the return value to facilitate better error
handling, and bring Worker.prototype.send() into compliance
with the documentation.

PR-URL: #6998
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ron Korving <ron@ronkorving.nl>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
rvagg pushed a commit that referenced this pull request Jun 2, 2016
There are several places in the cluster module where a version
of process.send() is called, but the result is swallowed. Most
of these cases are internal, but Worker.prototype.send(), which
is publicly documented, also suffers from this problem. This
commit exposes the return value to facilitate better error
handling, and bring Worker.prototype.send() into compliance
with the documentation.

PR-URL: #6998
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ron Korving <ron@ronkorving.nl>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@MylesBorins
Copy link
Contributor

@cjihrig lts?

@cjihrig
Copy link
Contributor Author

cjihrig commented Jul 11, 2016

Yes, please. The v4 documentation also says that a send() returns a Boolean.

@MylesBorins
Copy link
Contributor

Getting an error with this one

=== release test-cluster-worker-events ===
Path: parallel/test-cluster-worker-events
assert.js:90
  throw new assert.AssertionError({
  ^
AssertionError: undefined === true
    at Object.<anonymous> (/Users/thealphanerd/code/node/v4.x/test/parallel/test-cluster-worker-events.js:18:10)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:974:3
Command: out/Release/node /Users/thealphanerd/code/node/v4.x/test/parallel/test-cluster-worker-events.js

@cjihrig
Copy link
Contributor Author

cjihrig commented Jul 12, 2016

Ah, looks like this depends on #3516, which appears to have been dropped from LTS consideration.

@MylesBorins MylesBorins mentioned this pull request Jul 14, 2016
4 tasks
MylesBorins pushed a commit to MylesBorins/node that referenced this pull request Jul 14, 2016
There are several places in the cluster module where a version
of process.send() is called, but the result is swallowed. Most
of these cases are internal, but Worker.prototype.send(), which
is publicly documented, also suffers from this problem. This
commit exposes the return value to facilitate better error
handling, and bring Worker.prototype.send() into compliance
with the documentation.

PR-URL: nodejs#6998
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ron Korving <ron@ronkorving.nl>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cluster Issues and PRs related to the cluster subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants