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: us...@infra.apache.org With regards, Apache Git Services