summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Aune <kkraune@users.noreply.github.com>2023-03-10 09:19:20 +0100
committerGitHub <noreply@github.com>2023-03-10 09:19:20 +0100
commit6118c0519e0e47ca5d84392b2e239ffaa880e310 (patch)
treeafc216c7c25761c5e686da374aa7911188db764a
parent9329e285d9d4e96549a63064743be413817da780 (diff)
parent491c3ff05730d5ab2351eb292bfcfc2b126b7514 (diff)
Merge pull request #26391 from vespa-engine/hmusum/lower-log-level-19
Log zookeeper start message only on retries
-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