You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2022/07/23 08:31:33 UTC

[GitHub] [bookkeeper] wenbingshen commented on a diff in pull request #3418: fix Flaky-test: BookieZKExpireTest.testBookieServerZKSessionExpireBehaviour

wenbingshen commented on code in PR #3418:
URL: https://github.com/apache/bookkeeper/pull/3418#discussion_r928096822


##########
bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieZKExpireTest.java:
##########
@@ -177,13 +179,15 @@ conf, new TestBookieImpl(conf),
             log.info("Resuming threads");
             sendthread.resume();
 
-            // allow watcher thread to run
-            Thread.sleep(3000);
+            // allow client.waitForConnection() timeout
+            Thread.sleep(10000);
             assertFalse("Bookie should shutdown on losing zk session", server.isBookieRunning());
             assertFalse("Bookie Server should shutdown on losing zk session", server.isRunning());

Review Comment:
   The increase from 3 seconds to 10 seconds is because creating a bookie temporary node needs to wait for the old zk client to establish a connection with the server. There is a timeout period of conf.getZkTimeout()=6 seconds. Once the timeout period expires, the bookie service will Closed due to session timeout, the extra 4 seconds is to consolidate the stability of the test and give the bookie service a little extra time to perform the shutdown.



##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/zookeeper/ZooKeeperClient.java:
##########
@@ -356,6 +366,13 @@ private void onExpired() {
 
         logger.info("ZooKeeper session {} is expired from {}.",
                 Long.toHexString(getSessionId()), connectString);
+
+        if (!retryExpired) {
+            logger.warn("ZooKeeper session expired retries have been disabled");
+            return;
+        }
+

Review Comment:
   Recreating new zookeeper instances is prohibited here.



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org