summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2020-07-02 14:16:00 +0200
committerJon Bratseth <bratseth@gmail.com>2020-07-02 14:16:00 +0200
commit2b099ae866e7a99b27b364f6c26157e786cc090c (patch)
tree0ca3d795003f729eb8cf1477a5ad2ef1df4ef51b /config
parente940918acdd342277b8beabbeae89a6e72cfb83b (diff)
Separate logging for errors on get and apply config
Diffstat (limited to 'config')
-rw-r--r--config/src/main/java/com/yahoo/config/subscription/ConfigSubscriber.java17
1 files changed, 13 insertions, 4 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 dbe27e2933c..5fcbd4f8c21 100644
--- a/config/src/main/java/com/yahoo/config/subscription/ConfigSubscriber.java
+++ b/config/src/main/java/com/yahoo/config/subscription/ConfigSubscriber.java
@@ -435,14 +435,23 @@ public class ConfigSubscriber implements AutoCloseable {
singleSubscriber.configure(handle.getConfig());
startConfigThread(() -> {
while (!isClosed()) {
+ boolean hasNewConfig = false;
+
+ try {
+ hasNewConfig = nextConfig();
+ }
+ catch (Exception e) {
+ log.log(SEVERE, "Exception on receiving config. Ignoring this change.", e);
+ }
+
try {
- if (nextConfig() && handle.isChanged())
+ if (hasNewConfig)
singleSubscriber.configure(handle.getConfig());
}
catch (Exception e) {
- log.log(WARNING, "Exception on applying config " + configClass.getName() +
- " for config id " + configId + ": Ignoring this change: " +
- Exceptions.toMessageString(e));
+ log.warning("Exception on applying config " + configClass.getName() +
+ " for config id " + configId + ": Ignoring this change: " +
+ Exceptions.toMessageString(e));
}
}
}