zookeeper-dev mailing list archives

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

    https://github.com/apache/zookeeper/pull/707#discussion_r235808196
  
    --- 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 --
    
    I am hoping to reduce the need for synchronized blocks in follow-up changes.  For now,
I added a simple use of getAndSet() to detect multiple calls to createElectionAlgorithm()
and ensure that the QCM that's being dropped on the floor gets halted first.


---

Mime
View raw message