diff options
author | gjoranv <gv@oath.com> | 2018-04-11 16:51:33 +0200 |
---|---|---|
committer | gjoranv <gv@oath.com> | 2018-04-11 16:51:59 +0200 |
commit | 9a8a754fa7b9c5909e5d51aff2a3193466e22850 (patch) | |
tree | 0d670b9761ef7bef9abb41c0298512e0ba71e32b /container-disc | |
parent | 177392cd29ab9db2de0471d295cce0d0423ed726 (diff) |
Do not start the reconfigurerThread if qrConfig.restartOnDeploy.
+ Remove code that stopped the thread after one run, as the first
config generation is handled in init code.
Diffstat (limited to 'container-disc')
-rw-r--r-- | container-disc/src/main/java/com/yahoo/container/jdisc/ConfiguredApplication.java | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/container-disc/src/main/java/com/yahoo/container/jdisc/ConfiguredApplication.java b/container-disc/src/main/java/com/yahoo/container/jdisc/ConfiguredApplication.java index 38f64c9decc..1977b934253 100644 --- a/container-disc/src/main/java/com/yahoo/container/jdisc/ConfiguredApplication.java +++ b/container-disc/src/main/java/com/yahoo/container/jdisc/ConfiguredApplication.java @@ -86,7 +86,7 @@ public final class ConfiguredApplication implements Application { private ScheduledThreadPoolExecutor shutdownDeadlineExecutor; private Thread reconfigurerThread; private Thread portWatcher; - private volatile QrConfig qrConfig; + private QrConfig qrConfig; static { LogSetup.initVespaLogging("Container"); @@ -122,14 +122,13 @@ public final class ConfiguredApplication implements Application { @Override public void start() { qrConfig = getConfig(QrConfig.class); - log.info("QrConfig.restartOnDeploy: " + qrConfig.restartOnDeploy()); hackToInitializeServer(qrConfig); ContainerBuilder builder = createBuilderWithGuiceBindings(); configureComponents(builder.guiceModules().activate()); intitializeAndActivateContainer(builder); - startReconfigurerThread(); + if (! qrConfig.restartOnDeploy()) startReconfigurerThread(); portWatcher = new Thread(this::watchPortChange); portWatcher.setDaemon(true); portWatcher.start(); @@ -202,12 +201,6 @@ public final class ConfiguredApplication implements Application { ContainerBuilder builder = createBuilderWithGuiceBindings(); configurer.runOnceAndEnsureRegistryHackRun(builder.guiceModules().activate()); intitializeAndActivateContainer(builder); - if (qrConfig.restartOnDeploy()) { - log.info("Stopping reconfigurer thread."); - break; - } else { - log.info("Keeping reconfigurer thread alive."); - } } catch (ConfigInterruptedException | InterruptedException e) { break; } catch (Exception | LinkageError e) { // LinkageError: OSGi problems @@ -219,7 +212,7 @@ public final class ConfiguredApplication implements Application { "a bad state and will terminate", e); } } - log.info("Shutting down HandlersConfigurerDi"); + log.fine("Shutting down HandlersConfigurerDi"); }); reconfigurerThread.start(); } @@ -300,6 +293,7 @@ public final class ConfiguredApplication implements Application { } private void shutdownReconfigurerThread() { + if (reconfigurerThread == null) return; reconfigurerThread.interrupt(); try { //Workaround for component constructors masking InterruptedException. |