ZOOKEEPER-2488: Synchronized access to shuttingDownLE in QuorumPeer#342
ZOOKEEPER-2488: Synchronized access to shuttingDownLE in QuorumPeer#342bitgaoshu wants to merge 2 commits intoapache:masterfrom
Conversation
| private void electionAndSetCurVote() { | ||
| reconfigFlagClear(); | ||
| if (shuttingDownLE) { | ||
| startLeaderElection(); |
There was a problem hiding this comment.
How come we don't need to set shuttingDownLE back to false here?
There was a problem hiding this comment.
oh, sorry. it's my negligence. i will fix
DanBenediktson
left a comment
There was a problem hiding this comment.
It isn't obvious to me why it's not necessary to clear the flag in this path, which the code used to do. Tried digging around in the code to figure out what the flag was used for (I've basically never looked at the LE code before), and I'm still not certain either way whether it's actually necessary or not, but I'd be kind of surprised if it isn't.
|
To provide some context here regarding this JIRA issue - it was found as part of work on ZOOKEEPER-2080: https://issues.apache.org/jira/browse/ZOOKEEPER-2080?focusedCommentId=15391189&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15391189 |
| } | ||
| } | ||
|
|
||
| private void electionAndSetCurVote() { |
There was a problem hiding this comment.
IMHO,If you really want to refactor the code block(Line1137-Line1149) ,throws Exception may be better than catching exception in this function!
There was a problem hiding this comment.
enen, i think the exception can be appropriately handled in this function, why need to throw the exception to caller? :) thanks
No description provided.