You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2020/03/29 03:43:37 UTC

[GitHub] [accumulo] ctubbsii commented on a change in pull request #1575: Skip restricted ports in TServer port search

ctubbsii commented on a change in pull request #1575: Skip restricted ports in TServer port search
URL: https://github.com/apache/accumulo/pull/1575#discussion_r399739628
 
 

 ##########
 File path: server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
 ##########
 @@ -168,10 +171,33 @@ public static ServerAddress startServer(MetricsSystem metricsSystem, ServerConte
           addresses);
     } catch (TTransportException e) {
       if (portSearch) {
+        // Build a list of reserved ports - as identified by properties of type PropertyType.PORT
+        ArrayList<Integer> restrictedPorts = new ArrayList<Integer>();
+        for (Property p : Property.values()) {
+          if (p.getType().equals(PropertyType.PORT)) {
+            for (int element : config.getPort(p)) {
+              restrictedPorts.add(element);
+              if (log.isDebugEnabled()) {
+                log.debug("Adding port {} to list of restricted ports", element);
 
 Review comment:
   I don't think we need this debug statement here, but if there's an easy way to unit test the code with a mock configuration, that might be nice. Might need to move some of this port search logic into a separate method to make that easier.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services