aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorHarald Musum <musum@yahooinc.com>2021-11-12 12:11:23 +0100
committerHarald Musum <musum@yahooinc.com>2021-11-12 12:11:23 +0100
commit9394962c87cbce78d3e712792833aea3eccaa5a0 (patch)
tree1ee1ecaa5552d0a5a31427a014a6cf639d9a0b66 /config
parenta57aa3372155dfbe29a13fa893a9d47f50abc493 (diff)
Add some debug logging in ConfigSubscriber
To be able to see what is going on when getting config in client, how long it takes and to help when rewriting this code
Diffstat (limited to 'config')
-rw-r--r--config/src/main/java/com/yahoo/config/subscription/ConfigSubscriber.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/config/src/main/java/com/yahoo/config/subscription/ConfigSubscriber.java b/config/src/main/java/com/yahoo/config/subscription/ConfigSubscriber.java
index f5ed79a1d44..07132c460f9 100644
--- a/config/src/main/java/com/yahoo/config/subscription/ConfigSubscriber.java
+++ b/config/src/main/java/com/yahoo/config/subscription/ConfigSubscriber.java
@@ -14,6 +14,7 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.logging.Level;
import java.util.logging.Logger;
import static java.util.logging.Level.FINE;
@@ -293,10 +294,13 @@ public class ConfigSubscriber implements AutoCloseable {
// Keep on polling the subscriptions until we have a new generation across the board, or it times out
for (ConfigHandle<? extends ConfigInstance> h : subscriptionHandles) {
ConfigSubscription<? extends ConfigInstance> subscription = h.subscription();
+ log.log(Level.FINEST, () -> "Calling nextConfig for " + subscription.getKey());
if ( ! subscription.nextConfig(timeLeftMillis)) {
// This subscriber has no new state and we know it has exhausted all time
+ log.log(Level.FINEST, () -> "No new config for " + subscription.getKey());
return false;
}
+ log.log(Level.FINEST, () -> "Got new generation or config for " + subscription.getKey());
throwIfExceptionSet(subscription);
ConfigSubscription.ConfigState<? extends ConfigInstance> config = subscription.getConfigState();
if (currentGen == null) currentGen = config.getGeneration();
@@ -322,6 +326,7 @@ public class ConfigSubscriber implements AutoCloseable {
if (reconfigDue) {
// This indicates the clients will possibly reconfigure their services, so "reset" changed-logic in subscriptions.
// Also if appropriate update the changed flag on the handler, which clients use.
+ log.log(Level.FINE, () -> "Reconfig will happen for generation " + generation);
markSubsChangedSeen(currentGen);
synchronized (monitor) {
generation = currentGen;