aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorHarald Musum <musum@verizonmedia.com>2021-04-26 14:36:15 +0200
committerHarald Musum <musum@verizonmedia.com>2021-04-26 14:36:15 +0200
commitd7c0213a835dcc45e8cc8655433d4e084ea4c34d (patch)
tree9c8c6b3786d59c44677363a88164c4f9812bdf2e /config
parent6a9da01a5465826c380d2497e8fa4eb3e51d8e04 (diff)
Log more when config subscription fails
Diffstat (limited to 'config')
-rw-r--r--config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigRequester.java12
-rw-r--r--config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java5
2 files changed, 6 insertions, 11 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 51266f21846..f846231ac98 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
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config.subscription.impl;
import com.yahoo.config.ConfigInstance;
@@ -47,7 +47,6 @@ public class JRTConfigRequester implements RequestWaiter {
private int fatalFailures = 0; // independent of transientFailures
private int transientFailures = 0; // independent of fatalFailures
private final ScheduledThreadPoolExecutor scheduler;
- private Instant suspendWarningLogged = Instant.MIN;
private Instant noApplicationWarningLogged = Instant.MIN;
private static final Duration delayBetweenWarnings = Duration.ofSeconds(60);
private final ConnectionPool connectionPool;
@@ -196,11 +195,8 @@ public class JRTConfigRequester implements RequestWaiter {
long delay,
Connection connection) {
transientFailures++;
- if (suspendWarningLogged.isBefore(Instant.now().minus(delayBetweenWarnings))) {
- log.log(INFO, "Connection to " + connection.getAddress() +
- " failed or timed out, clients will keep existing config, will keep trying.");
- suspendWarningLogged = Instant.now();
- }
+ log.log(INFO, "Connection to " + connection.getAddress() +
+ " failed or timed out, clients will keep existing config, will keep trying.");
if (sub.getState() != ConfigSubscription.State.OPEN) return;
scheduleNextRequest(jrtReq, sub, delay, calculateErrorTimeout());
}
@@ -237,7 +233,6 @@ public class JRTConfigRequester implements RequestWaiter {
// Reset counters pertaining to error handling here
fatalFailures = 0;
transientFailures = 0;
- suspendWarningLogged = Instant.MIN;
noApplicationWarningLogged = Instant.MIN;
connection.setSuccess();
sub.setLastCallBackOKTS(Instant.now());
@@ -289,7 +284,6 @@ public class JRTConfigRequester implements RequestWaiter {
public void close() {
// Fake that we have logged to avoid printing warnings after this
- suspendWarningLogged = Instant.now();
noApplicationWarningLogged = Instant.now();
if (configSourceSet != null) {
managedPool.release(configSourceSet);
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 05558d3ee5c..2d25602bd66 100644
--- a/config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java
+++ b/config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config;
import com.yahoo.config.subscription.ConfigSourceSet;
@@ -10,6 +10,7 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ThreadLocalRandom;
+import java.util.logging.Level;
import java.util.logging.Logger;
import static java.util.logging.Level.FINE;
@@ -76,7 +77,7 @@ public class JRTConnectionPool implements ConnectionPool {
public synchronized JRTConnection setNewCurrentConnection() {
List<JRTConnection> sources = getSources();
currentConnection = sources.get(ThreadLocalRandom.current().nextInt(0, sources.size()));
- log.log(FINE, () -> "Choosing new connection: " + currentConnection);
+ log.log(Level.INFO, () -> "Choosing new connection: " + currentConnection);
return currentConnection;
}