-
Notifications
You must be signed in to change notification settings - Fork 29.1k
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: sometimes debug-port value for child process can be broken #1524
Changes from 2 commits
cd23c88
e71cfc8
2a8c5e7
5ee069b
4aa3f47
220e3d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var spawn = require('child_process').spawn; | ||
var cluster = require('cluster'); | ||
var assert = require('assert'); | ||
|
||
if (process.argv[2] == 'master') { | ||
if (cluster.isMaster) { | ||
cluster.fork().on('exit', function(code) { | ||
process.exit(code); | ||
}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: semicolon |
||
} else { | ||
process.exit(42); | ||
} | ||
} else { | ||
// iojs --debug-port=65535 test-cluster-debugport-overflow.js master | ||
spawn(process.argv[0], ['--debug-port=65535', __filename, 'master']).on('close', function(code){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style nits: line > 80 columns and missing space before brace. If you assign the arguments to a Ditto for the line in lib/cluster.js; eyeballing it, it looks to be just over 80 columns. |
||
assert.equal(42, code, 'Worker was started'); | ||
}); | ||
} |
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.
It would be a little neater to turn the number literal into a constant and use it in the range calculation above.
Aside, it's something of a (not consistently enforced) convention to name constants
kFoo
, i.e.: