remove unnecessary tlsPortFinder to avoid potential port conflicts (#6194)

This commit is contained in:
QiuMM 2018-08-24 01:41:49 +08:00 committed by Himanshu
parent a76bf9ab2a
commit ceb8f8e625
3 changed files with 2 additions and 15 deletions

View File

@ -1040,7 +1040,6 @@ Middle managers pass their configurations down to their child peons. The middle
|`druid.indexer.runner.javaOptsArray`|A json array of strings to be passed in as options to the peon's jvm. This is additive to javaOpts and is recommended for properly handling arguments which contain quotes or spaces like `["-XX:OnOutOfMemoryError=kill -9 %p"]`|`[]`|
|`druid.indexer.runner.maxZnodeBytes`|The maximum size Znode in bytes that can be created in Zookeeper.|524288|
|`druid.indexer.runner.startPort`|Starting port used for peon processes, should be greater than 1023.|8100|
|`druid.indexer.runner.tlsStartPort`|Starting TLS port for peon processes, should be greater than 1023.|8300|
|`druid.indexer.runner.separateIngestionEndpoint`|*Deprecated.* Use separate server and consequently separate jetty thread pool for ingesting events. Not supported with TLS.|false|
|`druid.worker.ip`|The IP of the worker.|localhost|
|`druid.worker.version`|Version identifier for the middle manager.|0|

View File

@ -104,7 +104,6 @@ public class ForkingTaskRunner implements TaskRunner, TaskLogStreamer
private final ListeningExecutorService exec;
private final ObjectMapper jsonMapper;
private final PortFinder portFinder;
private final PortFinder tlsPortFinder;
private final CopyOnWriteArrayList<Pair<TaskRunnerListener, Executor>> listeners = new CopyOnWriteArrayList<>();
// Writes must be synchronized. This is only a ConcurrentMap so "informational" reads can occur without waiting.
@ -130,7 +129,6 @@ public class ForkingTaskRunner implements TaskRunner, TaskLogStreamer
this.jsonMapper = jsonMapper;
this.node = node;
this.portFinder = new PortFinder(config.getStartPort());
this.tlsPortFinder = new PortFinder(config.getTlsStartPort());
this.exec = MoreExecutors.listeningDecorator(
Execs.multiThreaded(workerConfig.getCapacity(), "forking-task-runner-%d")
);
@ -247,7 +245,7 @@ public class ForkingTaskRunner implements TaskRunner, TaskLogStreamer
}
if (node.isEnableTlsPort()) {
tlsChildPort = tlsPortFinder.findUnusedPort();
tlsChildPort = portFinder.findUnusedPort();
}
final TaskLocation taskLocation = TaskLocation.create(childHost, childPort, tlsChildPort);
@ -515,7 +513,7 @@ public class ForkingTaskRunner implements TaskRunner, TaskLogStreamer
portFinder.markPortUnused(childPort);
}
if (node.isEnableTlsPort()) {
tlsPortFinder.markPortUnused(tlsChildPort);
portFinder.markPortUnused(tlsChildPort);
}
if (childChatHandlerPort > 0) {
portFinder.markPortUnused(childChatHandlerPort);

View File

@ -62,11 +62,6 @@ public class ForkingTaskRunnerConfig
@Max(65535)
private int startPort = 8100;
@JsonProperty
@Min(1024)
@Max(65535)
private int tlsStartPort = 8300;
@JsonProperty
@NotNull
List<String> allowedPrefixes = Lists.newArrayList(
@ -112,11 +107,6 @@ public class ForkingTaskRunnerConfig
return startPort;
}
public int getTlsStartPort()
{
return tlsStartPort;
}
public List<String> getAllowedPrefixes()
{
return allowedPrefixes;