diff options
author | Jon Bratseth <bratseth@oath.com> | 2018-06-01 01:07:33 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@oath.com> | 2018-06-01 01:07:33 +0200 |
commit | f7d0fe5fdfad579e867f01acc1d41b2ec77bd785 (patch) | |
tree | 2c9b2241bf49a01cf84a6fc0e3dd221b08fb30fe /container-core | |
parent | 4919fb84be7edc03f7c7feb0080ff0c5f705f654 (diff) |
Separate internal redeploys from application package changes
Separate system internal redeploys from application package
changes such that we can ignore config updates originating
from application package changes if restart on deploy is true,
as the config change will be followed by a restart - but continue
to effect config changes originating from internal system changes
as those will not (and should not) be followed by a restart.
Diffstat (limited to 'container-core')
2 files changed, 4 insertions, 7 deletions
diff --git a/container-core/src/main/java/com/yahoo/container/core/config/HandlersConfigurerDi.java b/container-core/src/main/java/com/yahoo/container/core/config/HandlersConfigurerDi.java index 41e3e43f156..0aefc83301d 100644 --- a/container-core/src/main/java/com/yahoo/container/core/config/HandlersConfigurerDi.java +++ b/container-core/src/main/java/com/yahoo/container/core/config/HandlersConfigurerDi.java @@ -86,7 +86,7 @@ public class HandlersConfigurerDi { container = new Container(subscriberFactory, configId, deconstructor, osgiWrapper); try { - getNewConfigGraph(discInjector, false); + getNewComponentGraph(discInjector, false); } catch (InterruptedException e) { throw new RuntimeException("Interrupted while setting up handlers for the first time."); } @@ -143,13 +143,10 @@ public class HandlersConfigurerDi { * * @return true if this resulted in a new graph that should be applied to the currently running container */ - public boolean getNewConfigGraph(Injector discInjector, boolean restartOnRedeploy) throws InterruptedException { - ComponentGraph newGraph = container.getNewConfigGraph(currentGraph, createFallbackInjector(vespaContainer, discInjector), restartOnRedeploy); - if (newGraph == currentGraph) return false; - currentGraph = newGraph; + public void getNewComponentGraph(Injector discInjector, boolean restartOnRedeploy) throws InterruptedException { + currentGraph = container.getNewComponentGraph(currentGraph, createFallbackInjector(vespaContainer, discInjector), restartOnRedeploy); assert (currentGraph.getInstance(RegistriesHack.class) != null); // TODO: Remove, seems quite pointless? - return true; } @SuppressWarnings("deprecation") diff --git a/container-core/src/main/java/com/yahoo/container/core/config/testutil/HandlersConfigurerTestWrapper.java b/container-core/src/main/java/com/yahoo/container/core/config/testutil/HandlersConfigurerTestWrapper.java index 008ca5c1d5a..afbf163500f 100644 --- a/container-core/src/main/java/com/yahoo/container/core/config/testutil/HandlersConfigurerTestWrapper.java +++ b/container-core/src/main/java/com/yahoo/container/core/config/testutil/HandlersConfigurerTestWrapper.java @@ -112,7 +112,7 @@ public class HandlersConfigurerTestWrapper { public void reloadConfig() { configurer.reloadConfig(++lastGeneration); try { - configurer.getNewConfigGraph(Guice.createInjector(), false); + configurer.getNewComponentGraph(Guice.createInjector(), false); } catch (InterruptedException e) { throw new RuntimeException(e); } |