[ https://issues.apache.org/jira/browse/ZOOKEEPER-2080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15478360#comment-15478360 ]
Flavio Junqueira commented on ZOOKEEPER-2080: --------------------------------------------- I thought a bit more about this. My understanding is that all operations related to the current quorum verifier need to be in the synchronized block. The shut down of leader election doesn't need to be in the synchronized block. I don't think "shuttingDownLE" needs to be synchronized with self, but given that it is accessed by multiple threads, it should be volatile. "shuttingDownLE" is a bit misleading because QP uses it to determine that it needs to start leader election, not that shut down is in progress. One thing that isn't entirely clear to me is whether QP can miss that "shuttingDownLE" is supposed to be true due to a race. Specifically, [https://github.com/apache/zookeeper/blob/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java#L1082 | here] is it possible that due to a race we miss that we are supposed to start LE? I think so because it doesn't seem to be synchronized. > ReconfigRecoveryTest fails intermittently > ----------------------------------------- > > Key: ZOOKEEPER-2080 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2080 > Project: ZooKeeper > Issue Type: Sub-task > Reporter: Ted Yu > Assignee: Michael Han > Fix For: 3.5.3, 3.6.0 > > Attachments: ZOOKEEPER-2080.patch, ZOOKEEPER-2080.patch, > ZOOKEEPER-2080.patch, ZOOKEEPER-2080.patch, > jacoco-ZOOKEEPER-2080.unzip-grows-to-70MB.7z, repro-20150816.log, > threaddump.log > > > I got the following test failure on MacBook with trunk code: > {code} > Testcase: testCurrentObserverIsParticipantInNewConfig took 93.628 sec > FAILED > waiting for server 2 being up > junit.framework.AssertionFailedError: waiting for server 2 being up > at > org.apache.zookeeper.server.quorum.ReconfigRecoveryTest.testCurrentObserverIsParticipantInNewConfig(ReconfigRecoveryTest.java:529) > at > org.apache.zookeeper.JUnit4ZKTestRunner$LoggedInvokeMethod.evaluate(JUnit4ZKTestRunner.java:52) > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)