zookeeper-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] enixon commented on a change in pull request #996: ZOOKEEPER-3240: Close socket on Learner shutdown to avoid dangling so…
Date Fri, 28 Jun 2019 23:04:23 GMT
enixon commented on a change in pull request #996: ZOOKEEPER-3240: Close socket on Learner
shutdown to avoid dangling so…
URL: https://github.com/apache/zookeeper/pull/996#discussion_r298771199
 
 

 ##########
 File path: zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java
 ##########
 @@ -827,7 +827,10 @@ public void testFailedTxnAsPartOfQuorumLoss() throws Exception {
         int leader = servers.findLeader();
         Map<Long, Proposal> outstanding =  servers.mt[leader].main.quorumPeer.leader.outstandingProposals;
         // increase the tick time to delay the leader going to looking
+        int previousTick = servers.mt[leader].main.quorumPeer.tickTime;
         servers.mt[leader].main.quorumPeer.tickTime = LEADER_TIMEOUT_MS;
+        // let the previous tick on the leader exhaust itself so the new tick time takes
effect
+        Thread.sleep(previousTick);
 
 Review comment:
   It comes down to timing. This test needs the leader to lag behind the actions taking place
on the other servers and this change gives the test the full advantage of the leader's changed
tick time. It seems that closing the socket alters the timing such that the stale Leader gets
an earlier awareness of its stale status without the change.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message