Separate logging for errors on get and apply config
@@ -435,12 +435,21 @@ 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() +
+ log.warning("Exception on applying config " + configClass.getName() +
" for config id " + configId + ": Ignoring this change: " +
Exceptions.toMessageString(e));
}
