[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14213518#comment-14213518
 ] 

Flavio Junqueira commented on ZOOKEEPER-2082:
---------------------------------------------

Good catch, upload a patch if you have a chance to work on one, please. We have 
deprecated implementations 0 1 2 of leader election, so this parameter won't be 
necessary any longer in future releases. 

> Mistype of electionAlgo can fill out your disk in minutes
> ---------------------------------------------------------
>
>                 Key: ZOOKEEPER-2082
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2082
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: leaderElection
>    Affects Versions: 3.4.6
>         Environment: Cluster (multi-server) setup
>            Reporter: Tianyin Xu
>            Priority: Minor
>
> The parameter, electionAlgo, is supposed to be 0--3. However, when I mistyped 
> the value in my zoo.cfg (I'm stupid), ZK falls into a dead loop and starts 
> filling up the entire disk which millions of the follow 2 lines...
> 2014-11-14 14:28:44,588 \[myid:3\] - INFO  
> \[QuorumPeer\[myid=3\]/0:0:0:0:0:0:0:0:2183:QuorumPeer@714\] - LOOKING
> 2014-11-14 14:28:44,588 \[myid:3\] - WARN  
> \[QuorumPeer\[myid=3\]/0:0:0:0:0:0:0:0:2183:QuorumPeer@764\] - Unexpected 
> exception
> java.lang.NullPointerException
>     at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:762)
> The error rooted in createElectionAlgorithm() where an invalid setting leads 
> to null for the Election object. Then, in the while look in run(), it causes 
> null-pointer de-referencing which is captured but is not handled well.
> I think our should check the setting of electionAlg in the very beginning to 
> make sure it's a valid setting, instead of using it at runtime and cause the 
> unfortunate things.
> Let me know if you wanna a patch. I'd like to check it in the 
> parseProperties() function in QuorumPeerConfig.java.
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to