tillrohrmann commented on a change in pull request #13163:
URL: https://github.com/apache/flink/pull/13163#discussion_r476443994
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/management/JMXService.java
##########
@@ -85,6 +86,9 @@ private static JMXServer
startJMXServerWithPortRanges(Iterator<Integer> ports) {
while (ports.hasNext() && successfullyStartedServer == null) {
JMXServer server = new JMXServer();
int port = ports.next();
+ if (port == 0) { // try poke with a random port when
port is set to zero
Review comment:
I would be hesitant in introducing this kind of magic with `0` mapping
to `10000 - 65000` in `NetUtils. getPortRangeFromString` because it will affect
all other callers of this utility as well. Isn't it good enough to simply
specify an explicit range if one runs multiple JMX services on the same node?
If this does not work for a good reason, then I think it would be better to
do this conversion in the realm of the `JMXServer` or its setup logic but not
for all users of the `NetUtils` class.
Also the special iterator looks a bit like pre-mature optimization to me. Do
we know that the startup period will be super long if we don't do this?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]