summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorHarald Musum <musum@yahooinc.com>2024-03-14 10:19:01 +0100
committerHarald Musum <musum@yahooinc.com>2024-03-14 10:19:01 +0100
commit14efd95e080c8c953816370b8c2dae0db576f762 (patch)
treeba2f97d4dda5faffe973d38abaf48a6892feb7a1 /config
parentb23f3efcf94767c413eb25ed2d39fb934fe3cc9b (diff)
Log at lower level when gettin config fails and when switching config sources
Diffstat (limited to 'config')
-rw-r--r--config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigRequester.java7
-rw-r--r--config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java2
-rw-r--r--config/src/main/java/com/yahoo/vespa/config/TimingValues.java2
3 files changed, 7 insertions, 4 deletions
diff --git a/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigRequester.java b/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigRequester.java
index ec1e040fdca..8f2f326503c 100644
--- a/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigRequester.java
+++ b/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigRequester.java
@@ -27,7 +27,6 @@ import static com.yahoo.jrt.ErrorCode.CONNECTION;
import static java.util.logging.Level.FINE;
import static java.util.logging.Level.FINEST;
import static java.util.logging.Level.INFO;
-import static java.util.logging.Level.SEVERE;
import static java.util.logging.Level.WARNING;
/**
@@ -148,7 +147,11 @@ public class JRTConfigRequester implements RequestWaiter {
log.log(INFO, () -> "Request failed: " + jrtReq.errorMessage() +
"\nConnection spec: " + connection);
} else if (timeForLastLogWarning.isBefore(Instant.now().minus(delayBetweenWarnings))) {
- log.log(WARNING, "Request failed: " + ErrorCode.getName(jrtReq.errorCode()) +
+ // Don't log a warning when failing and there are several config servers,
+ // some of them might be down or upgrading, which is fine
+ var level = connectionPool.getSize() > 1 ? FINE : WARNING;
+ log.log(level, () ->
+ "Request failed: " + ErrorCode.getName(jrtReq.errorCode()) +
". Connection spec: " + connection.getAddress() +
", error message: " + jrtReq.errorMessage());
timeForLastLogWarning = Instant.now();
diff --git a/config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java b/config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java
index 5a41527b6ea..e1546f88fa5 100644
--- a/config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java
+++ b/config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java
@@ -87,7 +87,7 @@ public class JRTConnectionPool implements ConnectionPool {
List<JRTConnection> sourceCandidates = getSources();
sourceCandidates.remove(currentConnection);
JRTConnection newConnection = pickNewConnectionRandomly(sourceCandidates);
- log.log(Level.INFO, () -> poolName + ": Switching from " + currentConnection + " to " + newConnection);
+ log.log(Level.FINE, () -> poolName + ": Switching from " + currentConnection + " to " + newConnection);
return currentConnection = newConnection;
}
diff --git a/config/src/main/java/com/yahoo/vespa/config/TimingValues.java b/config/src/main/java/com/yahoo/vespa/config/TimingValues.java
index 2ef6d36d2dc..7c56de1f45d 100644
--- a/config/src/main/java/com/yahoo/vespa/config/TimingValues.java
+++ b/config/src/main/java/com/yahoo/vespa/config/TimingValues.java
@@ -20,6 +20,7 @@ public class TimingValues {
private long fixedDelay = 5000;
private final Random rand;
+ // TODO: Document rationale for these values
public TimingValues() {
successTimeout = 600000;
errorTimeout = 20000;
@@ -27,7 +28,6 @@ public class TimingValues {
this.rand = new Random(System.currentTimeMillis());
}
- // TODO Should add nextConfigTimeout in all constructors
public TimingValues(long successTimeout,
long errorTimeout,
long initialTimeout,