You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by GitBox <gi...@apache.org> on 2019/03/21 20:35:30 UTC

[GitHub] [zookeeper] enixon commented on a change in pull request #863: ZOOKEEPER-3320: Leader election port stop listen when hostname unresolvable for some time

enixon commented on a change in pull request #863: ZOOKEEPER-3320: Leader election port stop listen when hostname unresolvable for some time
URL: https://github.com/apache/zookeeper/pull/863#discussion_r267946154
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumCnxManager.java
 ##########
 @@ -839,12 +839,17 @@ private void resetConnectionThreadCount() {
      */
     public class Listener extends ZooKeeperThread {
 
+        private final int portBindMaxRetry;
         volatile ServerSocket ss = null;
 
         public Listener() {
             // During startup of thread, thread name will be overridden to
             // specific election address
             super("ListenerThread");
+
+            // maximum retry count while trying to bind to election port
+            // see ZOOKEEPER-3320 for more details
+            portBindMaxRetry = Integer.getInteger("zookeeper.electionPortBindRetry", 3);
 
 Review comment:
   I'd recommend adding an info log that says what this property is set to when it reads and some validation in place to make sure the property is not negative.
   
   Overall change seems reasonable - let's see what the others think.

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