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

Alexander Shraer commented on ZOOKEEPER-1343:
---------------------------------------------

Flavio, I think you should add 

            if (leadThread != null) {
                leadThread.interrupt();
                leadThread.join();
            }       

at the end of your new test. I have the succeeding test periodically failing 
because the 33556 port used by both tests for the leader quorum port is still 
in use. Adding the code above would wait until the leader shuts down in your 
test.

Actually, in addition to the above fix, I think we should change all the 
manually assigned ports in Zab1_0Test to be assigned using 
Portassignment.unique() like in other tests (I can do that if people agree that 
this should be done). If I understand correctly the static counter used in 
unique() to assign ports is initialized once per test file, so it would also 
prevent the problem I'm seeing here of two tests in the same file trying to use 
the same port. 

Unfortunately I'm only seeing this in my branch and not in trunk.




                
> getEpochToPropose should check if lastAcceptedEpoch is greater or equal than 
> epoch
> ----------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1343
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1343
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.4.0
>            Reporter: Flavio Junqueira
>            Assignee: Flavio Junqueira
>            Priority: Critical
>             Fix For: 3.4.3, 3.5.0
>
>         Attachments: ZOOKEEPER-1343-3.4.patch, ZOOKEEPER-1343.patch, 
> ZOOKEEPER-1343.patch, ZOOKEEPER-1343.patch
>
>
> The following block in Leader.getEpochToPropose:
> {noformat}
> if (lastAcceptedEpoch > epoch) {
>       epoch = lastAcceptedEpoch+1;
> }
> {noformat}
> needs to be fixed, since it doesn't increment the epoch variable in the case 
> epoch != -1 (initial value) and lastAcceptedEpoch is equal. The fix trivial 
> and corresponds to changing > with >=. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to