summaryrefslogtreecommitdiffstats
path: root/zookeeper-server
diff options
context:
space:
mode:
authorHarald Musum <musum@yahooinc.com>2023-03-10 09:17:25 +0100
committerHarald Musum <musum@yahooinc.com>2023-03-10 09:17:25 +0100
commit491c3ff05730d5ab2351eb292bfcfc2b126b7514 (patch)
tree75bb35c048ab20d5b61ab18f99b71c4cadcfd7bd /zookeeper-server
parentc96886fe1c28babb62b2e837c6352d77edf3ee7e (diff)
Log zookeeper start message only on retries
Diffstat (limited to 'zookeeper-server')
-rw-r--r--zookeeper-server/zookeeper-server-common/src/main/java/com/yahoo/vespa/zookeeper/ZooKeeperRunner.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/zookeeper-server/zookeeper-server-common/src/main/java/com/yahoo/vespa/zookeeper/ZooKeeperRunner.java b/zookeeper-server/zookeeper-server-common/src/main/java/com/yahoo/vespa/zookeeper/ZooKeeperRunner.java
index b30607299ad..9ada45204e8 100644
--- a/zookeeper-server/zookeeper-server-common/src/main/java/com/yahoo/vespa/zookeeper/ZooKeeperRunner.java
+++ b/zookeeper-server/zookeeper-server-common/src/main/java/com/yahoo/vespa/zookeeper/ZooKeeperRunner.java
@@ -68,10 +68,7 @@ public class ZooKeeperRunner implements Runnable {
Instant end = now.plus(START_TIMEOUT);
for (int attempt = 1; now.isBefore(end) && !executorService.isShutdown(); attempt++) {
try {
- log.log(Level.INFO, "Starting ZooKeeper server with " + path.toFile().getAbsolutePath() +
- ". Trying to establish ZooKeeper quorum (members: " +
- zookeeperServerHostnames(zookeeperServerConfig) + ", attempt " + attempt + ")");
- startServer(path); // Will block in a real implementation of VespaZooKeeperServer
+ startServer(path, attempt); // Will block in a real implementation of VespaZooKeeperServer
return;
} catch (RuntimeException e) {
String messagePart = "Starting " + serverDescription() + " failed on attempt " + attempt;
@@ -96,7 +93,12 @@ public class ZooKeeperRunner implements Runnable {
return (server.reconfigurable() ? "" : "non-") + "reconfigurable ZooKeeper server";
}
- private void startServer(Path path) {
+ private void startServer(Path path, int attempt) {
+ if (attempt > 1)
+ log.log(Level.INFO, "Starting ZooKeeper server with " + path.toFile().getAbsolutePath() +
+ ". Trying to establish ZooKeeper quorum (members: " +
+ zookeeperServerHostnames(zookeeperServerConfig) + ", attempt " + attempt + ")");
+
// Note: Hack to make this work in ZooKeeper 3.6, where metrics provider class is
// loaded by using Thread.currentThread().getContextClassLoader() which does not work
// well in the container