You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by hi...@apache.org on 2018/08/23 17:41:53 UTC

[incubator-druid] branch master updated: remove unnecessary tlsPortFinder to avoid potential port conflicts (#6194)

This is an automated email from the ASF dual-hosted git repository.

himanshug pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-druid.git


The following commit(s) were added to refs/heads/master by this push:
     new ceb8f8e  remove unnecessary tlsPortFinder to avoid potential port conflicts (#6194)
ceb8f8e is described below

commit ceb8f8e6258e1d113d8162a9a8a2fc62810704eb
Author: QiuMM <cs...@gmail.com>
AuthorDate: Fri Aug 24 01:41:49 2018 +0800

    remove unnecessary tlsPortFinder to avoid potential port conflicts (#6194)
---
 docs/content/configuration/index.md                            |  1 -
 .../java/io/druid/indexing/overlord/ForkingTaskRunner.java     |  6 ++----
 .../indexing/overlord/config/ForkingTaskRunnerConfig.java      | 10 ----------
 3 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/docs/content/configuration/index.md b/docs/content/configuration/index.md
index 5eb03a6..5f970c0 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 6326fc0..37462d2 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 @@ 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);
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 fbe171e..4c1bfd1 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
@@ -63,11 +63,6 @@ public class ForkingTaskRunnerConfig
   private int startPort = 8100;
 
   @JsonProperty
-  @Min(1024)
-  @Max(65535)
-  private int tlsStartPort = 8300;
-
-  @JsonProperty
   @NotNull
   List<String> allowedPrefixes = Lists.newArrayList(
       "com.metamx",
@@ -112,11 +107,6 @@ public class ForkingTaskRunnerConfig
     return startPort;
   }
 
-  public int getTlsStartPort()
-  {
-    return tlsStartPort;
-  }
-
   public List<String> getAllowedPrefixes()
   {
     return allowedPrefixes;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org