Github user anmolnar commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/707#discussion_r235416627
  
    --- Diff: 
zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumPeer.java
 ---
    @@ -755,39 +769,55 @@ public void recreateSocketAddresses(long id) {
             }
         }
     
    -    public InetSocketAddress getQuorumAddress(){
    -        synchronized (QV_LOCK) {
    -            return myQuorumAddr;
    +    InetSocketAddress getQuorumAddress(){
    --- End diff --
    
    You might want to put the double-check-locking mechanism into a private 
getter of `myAddrs` to consolidate the logic in these 2 getters.


---

Reply via email to