zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eolivelli <...@git.apache.org>
Subject [GitHub] zookeeper pull request #707: [ZOOKEEPER-2778] QuorumPeer: encapsulate addres...
Date Thu, 22 Nov 2018 12:48:09 GMT
Github user eolivelli commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/707#discussion_r235713462
  
    --- Diff: zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumPeer.java
---
    @@ -108,7 +109,11 @@
         LocalPeerBean jmxLocalPeerBean;
         private Map<Long, RemotePeerBean> jmxRemotePeerBean;
         LeaderElectionBean jmxLeaderElectionBean;
    -    private QuorumCnxManager qcm;
    +
    +    // The QuorumCnxManager is held through an AtomicReference to ensure cross-thread
visibility
    +    // of updates; see the implementation comment at setLastSeenQuorumVerifier().
    +    private AtomicReference<QuorumCnxManager> qcmRef = new AtomicReference<>();
    --- End diff --
    
    If we are not using Compare and set, why a volatile is not enough?


---

Mime
View raw message