[
https://issues.apache.org/jira/browse/ZOOKEEPER-2488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16140122#comment-16140122
]
ASF GitHub Bot commented on ZOOKEEPER-2488:
-------------------------------------------
Github user maoling commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/342#discussion_r135038449
--- Diff: src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java
---
@@ -1155,6 +1134,19 @@ public void run() {
}
}
+ private void electionAndSetCurVote() {
--- End diff --
IMHO,If you really want to refactor the code block(**Line1137-Line1149**)
**,throws Exception** may be better than catching exception in this function!
> Unsynchronized access to shuttingDownLE in QuorumPeer
> -----------------------------------------------------
>
> Key: ZOOKEEPER-2488
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2488
> Project: ZooKeeper
> Issue Type: Bug
> Components: server
> Affects Versions: 3.5.2
> Reporter: Michael Han
> Fix For: 3.5.4, 3.6.0
>
>
> Access to shuttingDownLE in QuorumPeer is not synchronized here:
> https://github.com/apache/zookeeper/blob/3c37184e83a3e68b73544cebccf9388eea26f523/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java#L1066
> https://github.com/apache/zookeeper/blob/3c37184e83a3e68b73544cebccf9388eea26f523/src/java/main/org/
> The access should be synchronized as the same variable might be accessed
> in QuormPeer::restartLeaderElection, which is synchronized.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)