Skip to content

cluster: expose result of send() - #6998

Merged
cjihrig merged 1 commit into
nodejs:masterfrom
cjihrig:send
May 31, 2016
Merged

cluster: expose result of send()#6998
cjihrig merged 1 commit into
nodejs:masterfrom
cjihrig:send

Conversation

@cjihrig

Copy link
Copy Markdown
Contributor
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-botnodejs-github-bot added the cluster Issues and PRs related to the cluster subsystem. label May 26, 2016
@cjihrig

Copy link
Copy Markdown
ContributorAuthor

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

@jasnell

Copy link
Copy Markdown
Member

LGTM but semver-minor?

@cjihrig

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
Member

Ok, works for me

@ronkorving

Copy link
Copy Markdown
Contributor

LGTM

@cjihrig

cjihrig commented May 27, 2016

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
Member

LGTM

@cjihrig

cjihrig commented May 28, 2016

Copy link
Copy Markdown
ContributorAuthor

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:masterMay 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
Copy Markdown
Contributor

@cjihrig lts?

@cjihrig

Copy link
Copy Markdown
ContributorAuthor

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

@MylesBorins

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

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

@MylesBorinsMylesBorins 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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clusterIssues and PRs related to the cluster subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@cjihrig@jasnell@ronkorving@bnoordhuis@MylesBorins@nodejs-github-bot