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

ASF GitHub Bot commented on ZOOKEEPER-1932:
-------------------------------------------

Github user hanm commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/106#discussion_r115353405
  
    --- Diff: src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java 
---
    @@ -930,39 +918,36 @@ protected Election createElectionAlgorithm(int 
electionAlgorithm){
     
             //TODO: use a factory rather than a switch
             switch (electionAlgorithm) {
    -        case 0:
    -            le = new LeaderElection(this);
    -            break;
    -        case 1:
    -            le = new AuthFastLeaderElection(this);
    -            break;
    -        case 2:
    -            le = new AuthFastLeaderElection(this, true);
    -            break;
    -        case 3:
    -            qcm = new QuorumCnxManager(this);
    -            QuorumCnxManager.Listener listener = qcm.listener;
    -            if(listener != null){
    -                listener.start();
    -                FastLeaderElection fle = new FastLeaderElection(this, qcm);
    -                fle.start();
    -                le = fle;
    -            } else {
    -                LOG.error("Null listener when initializing cnx manager");
    -            }
    -            break;
    -        default:
    -            assert false;
    +            case 0:
    +                assert false : "Leader election algorithm type 0 is not 
supported anymore.";
    --- End diff --
    
    I like the idea of catching invalid electionAlg value when parsing config 
file. Code updated by throwing an exception when input value is bad.


> org.apache.zookeeper.test.LETest.testLE fails once in a while
> -------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1932
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1932
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: leaderElection
>    Affects Versions: 3.5.0
>            Reporter: Michi Mutsuzaki
>            Assignee: Michael Han
>             Fix For: 3.6.0
>
>         Attachments: TEST-org.apache.zookeeper.test.LETest.txt, 
> ZOOKEEPER-1932.patch, ZOOKEEPER-1932.patch
>
>
> org.apache.zookeeper.test.LETest.testLE is failing on trunk once in a while. 
> I'm not able to reproduce the failure on my box. I looked at the log, but I 
> couldn't quite figure out what's going on. 
> https://builds.apache.org/view/S-Z/view/ZooKeeper/job/ZooKeeper-trunk/2315/testReport/
> Update:
> ======
> Because LE is deprecated there is not much points on spending effort fixing 
> it, as discussed in the JIRA. Updated JIRA title to reflect the state of the 
> issue.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to