himanshug closed pull request #6194: remove unnecessary tlsPortFinder to avoid 
potential port conflicts
URL: https://github.com/apache/incubator-druid/pull/6194
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/docs/content/configuration/index.md 
b/docs/content/configuration/index.md
index 5eb03a627e9..5f970c032ea 100644
--- a/docs/content/configuration/index.md
+++ b/docs/content/configuration/index.md
@@ -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|
diff --git 
a/indexing-service/src/main/java/io/druid/indexing/overlord/ForkingTaskRunner.java
 
b/indexing-service/src/main/java/io/druid/indexing/overlord/ForkingTaskRunner.java
index 6326fc04be9..37462d294dd 100644
--- 
a/indexing-service/src/main/java/io/druid/indexing/overlord/ForkingTaskRunner.java
+++ 
b/indexing-service/src/main/java/io/druid/indexing/overlord/ForkingTaskRunner.java
@@ -104,7 +104,6 @@
   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 ForkingTaskRunner(
     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 TaskStatus call()
                         }
 
                         if (node.isEnableTlsPort()) {
-                          tlsChildPort = tlsPortFinder.findUnusedPort();
+                          tlsChildPort = portFinder.findUnusedPort();
                         }
 
                         final TaskLocation taskLocation = 
TaskLocation.create(childHost, childPort, tlsChildPort);
@@ -515,7 +513,7 @@ public TaskStatus call()
                               portFinder.markPortUnused(childPort);
                             }
                             if (node.isEnableTlsPort()) {
-                              tlsPortFinder.markPortUnused(tlsChildPort);
+                              portFinder.markPortUnused(tlsChildPort);
                             }
                             if (childChatHandlerPort > 0) {
                               portFinder.markPortUnused(childChatHandlerPort);
diff --git 
a/indexing-service/src/main/java/io/druid/indexing/overlord/config/ForkingTaskRunnerConfig.java
 
b/indexing-service/src/main/java/io/druid/indexing/overlord/config/ForkingTaskRunnerConfig.java
index fbe171eb8ae..4c1bfd1391a 100644
--- 
a/indexing-service/src/main/java/io/druid/indexing/overlord/config/ForkingTaskRunnerConfig.java
+++ 
b/indexing-service/src/main/java/io/druid/indexing/overlord/config/ForkingTaskRunnerConfig.java
@@ -62,11 +62,6 @@
   @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 int getStartPort()
     return startPort;
   }
 
-  public int getTlsStartPort()
-  {
-    return tlsStartPort;
-  }
-
   public List<String> getAllowedPrefixes()
   {
     return allowedPrefixes;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to