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: emit 'message' event on cluster master #861

Closed
wants to merge 420 commits into from

Conversation

sam-github
Copy link
Contributor

Four of the following five events that are emitted on workers are also emitted on the cluster master.

Which one is not?

  • 'disconnect'
  • 'exit'
  • 'listening'
  • 'message'
  • 'online'

The node API should not lend itself to trivia quiz questions.

Full disclosure: This change has been rejected before on the basis that the cluster module doesn't need more "sugar", but I'd like it to be reconsidered, not from a point of view of whether it needs more sugar (it doesn't), but from a point of view of whether its reasonable to have such inconsistent API choices.

/to @bnoordhuis

@Fishrock123
Copy link
Contributor

ping @bnoordhuis

@Fishrock123 Fishrock123 added the cluster Issues and PRs related to the cluster subsystem. label Mar 13, 2015
@tellnes
Copy link
Contributor

tellnes commented Mar 28, 2015

LGTM.

+1 to consistency.

@@ -5,7 +5,7 @@ var net = require('net');

function forEach(obj, fn) {
Object.keys(obj).forEach(function(name, index) {
fn(obj[name], name, index);
fn(obj[name], name);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems unrelated

evanlucas and others added 25 commits May 28, 2015 09:38
Creates two new internal modules (child_process and socket_list) for
better readability.

Exposes the ChildProcess constructor from the child_process module so
one can now `require(‘child_process’).ChildProcess`

Fixes: nodejs#1751
PR-URL: nodejs#1760
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
This reverts commit 3c44100.

Reverted for breaking node-heapdump[0].

AsyncWrap assigns a class id but does not set a v8::RetainedObjectInfo
provider callback with v8::HeapProfiler::SetWrapperClassInfoProvider().
The result is a null pointer dereference when taking a heap snapshot.

It can probably be solved by setting a generic provider callback inside
the AsyncWrap constructor but that may have performance ramifications
that need to be investigated first.  I move to revert it for now.

[0] https://github.com/bnoordhuis/node-heapdump

PR-URL: nodejs#1827
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Add a regression test for nodejs#1827.

PR-URL: nodejs#1828
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
`flushHeaders` should work for header written
with `writeHead`.

PR-URL: nodejs#1695
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
On a few of our installations (namely CentOS), passing 'INFO'
resulted in a silent loglevel. Use a logging constant instead.

Fixes: nodejs/build#104
PR-URL: nodejs#1842
Reviewed-By: Rod Vagg <rod@vagg.org>
The Socket writable only change was added and implemented in the
constructor around 5885f46, but this was never removed.

The libev counter issue is no longer prudent; the test remains in
test/sequential/test-regress-GH-1726.

PR-URL: nodejs#1819
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: nodejs#1829
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Every npm version bump requires a few patches to be floated on
node-gyp for io.js compatibility. These patches are found in
03d1992,
5de334c, and
da730c7. This commit squashes
them into a single commit.

PR-URL: nodejs#990
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
The delay-load hook allows node.exe/iojs.exe to be renamed. See efadffe
for more background.

This commit is a combined squash of the following previous patches:
ba93c58,
3bda6cb,
0d6d3dd.

PR-URL: nodejs#1763
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
When the preload module is not a abs/relative path, we should use
the standard search mechanism of looking into the node_modules folders
outwards. The current working directory is deemed to be the 'requiring
module', i.e. parent. The search path starts from cwd outwards.

Fixes: nodejs#1803
PR-URL: nodejs#1812
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
This change eliminates an unnecessary setTimeout() in the test.

PR-URL: nodejs#1821
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
PR-URL: nodejs#1808

Notable Changes:

* node: Speed-up require() by replacing usage of fs.statSync() and
  fs.readFileSync() with internal variants that are faster for this use-case
  and do not create as many objects for the garbage collector to clean up.
  The primary two benefits are: significant increase in application start-up
  time on typical applications and better start-up time for the debugger by
  eliminating almost all of the thousands of exception events.
  (Ben Noordhuis) nodejs#1801.
* node: Resolution of pre-load modules (-r or --require) now follows the
  standard require() rules rather than just resolving paths, so you can now
  pre-load modules in node_modules. (Ali Ijaz Sheikh) nodejs#1812.
* npm: Upgraded npm to v2.11.0. New hooks for preversion, version, and
  postversion lifecycle events, some SPDX-related license changes and license
  file inclusions. See the release notes for full details.
The improper deprecation of the property broke a feature in the
request module used by the bundled npm. This reverts the deprecation
part of this change.

PR-URL: nodejs#1852
Fixes: nodejs#1850
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Roman Reiss <me@silverwind.io>
While checking the return values from icu-i18n, we didn't
validate the content before passing it to the build system.

Also make cflags parsing more robust by avoiding empty strings.

Fixes: nodejs#1787
PR-URL: nodejs#1789
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: nodejs#1856

Notable Changes:

* http: reverts the removal of an undocumented `client` property on client
  connections, this property is being used in the wild, most notably by
  https://github.com/request/request which is used by npm.
  (Michaël Zasso) [nodejs#1852](nodejs#1852).
This fixes a platform inconsistency between BSD and GNU `cp` where
`deps/npm` would be copied into a subdirectory of `test-npm` on Linux,
but not on OS X.

PR-URL: nodejs#1853
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
PR-URL: nodejs#1859
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Options have been moved into the NodeOptions class.
A new global, node_options now exists and is used
to access the options after the command line arguments
have been parsed.

PR-URL: nodejs#1804
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This reverts commit c0e7bf2.

There are a few edge cases that can cause a crash
and need to be properly handled.

PR-URL: nodejs#1862
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
 - `sh.css` already exists in `api_assets`
 - `sh_vim-dark.css` is unused, but used in the repo `node-website`
        now

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Signed-off-by: Julien Gilli <julien.gilli@joyent.com>

PORT-FROM: joyent/node @ 0c50195
PR-URL: nodejs#1770
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Clarify that synchronous functions in fs with no return value return
undefined.

Specify that fs.openSync() returns an integer and fs.existsSync()
returns true or false.

Fixes: nodejs/node-v0.x-archive#9313

PR: nodejs/node-v0.x-archive#9359
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>

PORT-FROM: joyent/node @ 51fe319
PR-URL: nodejs#1770
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>

Conflicts:
	doc/api/fs.markdown
PR-URL: nodejs#1858
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Fishrock123 and others added 2 commits July 17, 2015 16:23
As per the dicussion in nodejs#569,
this patch issues a deprecation warning when freelist module is
required. A test file for freelist is also added.

PR-URL: nodejs#2176
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
thefourtheye and others added 2 commits July 18, 2015 04:10
Refer: nodejs#2102

PR-URL: nodejs#2199
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Ref: nodejs#2102

PR-URL: nodejs#2200
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
@sam-github
Copy link
Contributor Author

Had to rebase onto master so I could run CI on this: https://jenkins-iojs.nodesource.com/job/iojs+any-pr+multi/166/

@thefourtheye
Copy link
Contributor

@sam-github Are you sure that the rebasing is fine?

phillipj and others added 5 commits July 19, 2015 17:00
Changes to core modules do not take effect unless recompiled. Tip new
contributors about this when describing how to run tests in
contribution guide.

Removed `jslint` from first test command example, as jslint is included
when running `make test`.

Fixed wrong path of example stream2-transform test.

PR-URL: nodejs#2051
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
PR-URL: nodejs#2191
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
This patch makes the skip messages consistent so that the TAP plugin
in CI can parse the messages properly. The format will be

    1..0 # Skipped: [Actual reason why the test is skipped]

PR-URL: nodejs#2109
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
This patch uses `return` statement to skip the test instead of using
`process.exit` call.

PR-URL: nodejs#2109
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
For consistency with the worker 'exit', 'online', 'disconnect', and
'listening' events which are emitted on worker and cluster, also emit
'message' on cluster.
@sam-github
Copy link
Contributor Author

@sam-github
Copy link
Contributor Author

Still looking at the test failures....

@brendanashworth
Copy link
Contributor

CI is happy

@thefourtheye
Copy link
Contributor

This PR has 7760 changed files :O

@sam-github
Copy link
Contributor Author

OK, all the linux passed, except for one that is hung: https://jenkins-iojs.nodesource.com/job/iojs+pr+linux/169/

windows is green, except for the build that failed with a git error

os x passed

https://jenkins-iojs.nodesource.com/job/iojs+any-pr+multi/186/?auto_refresh=true

I'll land this on master.

@thefourtheye this PR is just io.js/master + 766b612, it looks bad in the PR because the PR is targeted at the 1.x branch, so it contains all of master since v1.x diverged. Unfortunately, github doesn't allow retargeting a PR at a new branch. I could've opened a new PR and closed this one, I suppose, though losing the conversation is annoying, too.

@sam-github sam-github added the semver-minor PRs that contain new features and should be released in the next minor version. label Jul 23, 2015
sam-github added a commit to sam-github/node that referenced this pull request Jul 23, 2015
For consistency with the worker 'exit', 'online', 'disconnect', and
'listening' events which are emitted on worker and cluster, also emit
'message' on cluster.

Reviewed-by: Sam Roberts <vieuxtech@gmail.com>
Reviewed-by: Christian Tellnes <christian@tellnes.no>
Reviewed-by: Stephen Belanger <admin@stephenbelanger.com>
PR-URL: nodejs#861
@sam-github
Copy link
Contributor Author

Landed in 66fc8ca

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. semver-minor PRs that contain new features and should be released in the next minor version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.