diff options
author | Jon Bratseth <bratseth@gmail.com> | 2020-07-02 11:54:43 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2020-07-02 11:54:43 +0200 |
commit | eb37f7dcbd89143715fbe9b838a91b296db0a3c9 (patch) | |
tree | a065cc8ffe0bee8fc9022fd32a926ff5712542c6 /container-di/src/main/java/com/yahoo/container/di/CloudSubscriberFactory.java | |
parent | b4abecef92c802ee6f779dc77d4328cc6fbf22cb (diff) |
Improvements to handling of cluster removal
- Don't change health status to "initializing" when creating a new VipStatus,
as 'initializing' now requires all clusters to be up to transition to 'up',
which means that if we're already up but are missing a cluster we'll go from
'up' to 'initializing' and stay there.
- Forget up/down status for removed clusters.
- Nicer logging on ignorable reconfiguration errors.
Diffstat (limited to 'container-di/src/main/java/com/yahoo/container/di/CloudSubscriberFactory.java')
-rw-r--r-- | container-di/src/main/java/com/yahoo/container/di/CloudSubscriberFactory.java | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/container-di/src/main/java/com/yahoo/container/di/CloudSubscriberFactory.java b/container-di/src/main/java/com/yahoo/container/di/CloudSubscriberFactory.java index bd3d146cfec..1133363be8e 100644 --- a/container-di/src/main/java/com/yahoo/container/di/CloudSubscriberFactory.java +++ b/container-di/src/main/java/com/yahoo/container/di/CloudSubscriberFactory.java @@ -103,29 +103,27 @@ public class CloudSubscriberFactory implements SubscriberFactory { @Override public long waitNextGeneration() { - if (handles.isEmpty()) { + if (handles.isEmpty()) throw new IllegalStateException("No config keys registered"); - } - /* Catch and just log config exceptions due to missing config values for parameters that do - * not have a default value. These exceptions occur when the user has removed a component - * from services.xml, and the component takes a config that has parameters without a - * default value in the def-file. There is a new 'components' config underway, where the - * component is removed, so this old config generation will soon be replaced by a new one. */ + // Catch and just log config exceptions due to missing config values for parameters that do + // not have a default value. These exceptions occur when the user has removed a component + // from services.xml, and the component takes a config that has parameters without a + // default value in the def-file. There is a new 'components' config underway, where the + // component is removed, so this old config generation will soon be replaced by a new one. boolean gotNextGen = false; int numExceptions = 0; while ( ! gotNextGen) { try { - if (subscriber.nextGeneration()) { + if (subscriber.nextGeneration()) gotNextGen = true; - } - } catch (IllegalArgumentException e) { + } + catch (IllegalArgumentException e) { numExceptions++; - log.log(Level.WARNING, "Got exception from the config system (please ignore the exception if you just removed " - + "a component from your application that used the mentioned config): ", e); - if (numExceptions >= 5) { - throw new IllegalArgumentException("Failed retrieving the next config generation.", e); - } + log.log(Level.WARNING, "Got exception from the config system (ignore if you just removed a " + + "component from your application that used the mentioned config): ", e); + if (numExceptions >= 5) + throw new IllegalArgumentException("Failed retrieving the next config generation", e); } } |