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/04/02 15:51:49 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_r402421292
 
 

 ##########
 File path: server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
 ##########
 @@ -168,10 +189,20 @@ 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
+        Map<Integer,Property> reservedPorts = getReservedPorts(config);
+
         HostAndPort last = addresses[addresses.length - 1];
         // Attempt to allocate a port outside of the specified port property
         // Search sequentially over the next 1000 ports
         for (int port = last.getPort() + 1; port < last.getPort() + 1001; port++) {
+          if (reservedPorts.keySet().contains(port)) {
 
 Review comment:
   I'm going to merge now. I can make this change subsequently.

----------------------------------------------------------------
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