cluster: fix debugging port collision#12395
Closed
Ajido wants to merge 1 commit intonodejs:masterfrom
Closed
Conversation
cjihrig
requested changes
Apr 13, 2017
lib/internal/cluster/master.js
Outdated
Contributor
There was a problem hiding this comment.
This will match flags that specify a host, but it seems like the host would then be lost when the flag is rewritten for the worker process a few lines down.
Contributor
Author
There was a problem hiding this comment.
Thanks. I'm thinking about addding process._debugHostname to avoid complex regex, what do you think?
diff --git a/lib/internal/cluster/master.js b/lib/internal/cluster/master.js
index c7b06b8..2a7379b 100644
--- a/lib/internal/cluster/master.js
+++ b/lib/internal/cluster/master.js
@@ -124,7 +124,7 @@ function createWorkerProcess(id, env) {
++debugPortOffset;
}
- execArgv[i] = match[1] + '=' + debugPort;
+ execArgv[i] = match[1] + '=' + process._debugHostname + ':' + debugPort;
}
}
diff --git a/src/node.cc b/src/node.cc
index c241f73..f091ac7 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -3361,6 +3361,8 @@ void SetupProcessObject(Environment* env,
DebugPortSetter,
env->as_external()).FromJust());
+ READONLY_PROPERTY(process, "_debugHostname", OneByteString(env->isolate(), debug_options.host_name().c_str()));
+
// define various internal methods
env->SetMethod(process,
"_startProfilerIdleNotifier",Fixing an issue that giving a debugging option including a hostname stop the cluster worker by EADDRINUSE.
1029159 to
ba90b6e
Compare
Member
|
Superseded by #13619. Thanks for the pull request though. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixing an issue that giving a debugging option including a hostname
stop the cluster worker by EADDRINUSE.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
src, cluster, test