diff options
author | Harald Musum <musum@yahooinc.com> | 2021-11-08 21:33:57 +0100 |
---|---|---|
committer | Harald Musum <musum@yahooinc.com> | 2021-11-08 21:33:57 +0100 |
commit | 095e980ab075bb6b478ad0d334282eeb47f1d181 (patch) | |
tree | c6677d0860ac540b6774629ef9a7f923718fdb8b /config-proxy | |
parent | 401ef5852764dee9a7e1568057c11f240ae6be9e (diff) |
Log error when getting null config and don't return it
Diffstat (limited to 'config-proxy')
-rw-r--r-- | config-proxy/src/main/java/com/yahoo/vespa/config/proxy/Subscriber.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/Subscriber.java b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/Subscriber.java index abe0ec5cbb0..70ff4456f6c 100644 --- a/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/Subscriber.java +++ b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/Subscriber.java @@ -43,8 +43,13 @@ public class Subscriber { public Optional<RawConfig> nextGeneration() { try { - if (subscriber.nextGeneration(0, true))// Proxy should never skip config due to not initializing - return Optional.of(handle.getRawConfig()); + // 'isInitializing' argument to nextGeneration() is true, config proxy should never skip config due to not initializing + if (subscriber.nextGeneration(0, true)) { + RawConfig rawConfig = handle.getRawConfig(); + if (rawConfig == null) + log.log(Level.SEVERE, "Config for " + config.getKey() + " is null"); + return Optional.ofNullable(rawConfig); + } } catch (Exception e) { // To avoid thread throwing exception and loop never running this again log.log(Level.WARNING, "Got exception: " + Exceptions.toMessageString(e)); } catch (Throwable e) { |