diff options
author | Jon Bratseth <bratseth@gmail.com> | 2020-11-23 14:29:32 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2020-11-23 14:29:32 +0100 |
commit | 5ae2b57fe0574aeba67a3ae85bc796a16c18d06e (patch) | |
tree | ea2c88c07a112b1c88f95a74c92b40b5d89f6457 /container-disc | |
parent | d5fa517246cb0647123615b9b10d6054b9c759c6 (diff) |
Make restart on deploy sticky
When restartOnDeploy is set on a config generation, no further config generations
should be applied before the node has been restarted. This is necessary because
the decision on whether restartOnDeploy shouild be set is made by comparing the
current and next config generation on the config server, not the next and the
current one active on the node.
Diffstat (limited to 'container-disc')
-rw-r--r-- | container-disc/src/main/java/com/yahoo/container/jdisc/ConfiguredApplication.java | 6 |
1 files changed, 5 insertions, 1 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 4614f8f9857..3158c06b0b1 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 @@ -261,12 +261,16 @@ public final class ConfiguredApplication implements Application { private void startReconfigurerThread() { reconfigurerThread = new Thread(() -> { + boolean restartOnDeploy = false; while ( ! Thread.interrupted()) { try { ContainerBuilder builder = createBuilderWithGuiceBindings(); + // Restart on deploy is sticky: Once it is set no future generation should be applied until restart + restartOnDeploy = restartOnDeploy || qrConfig.restartOnDeploy(); + // Block until new config arrives, and it should be applied - configurer.getNewComponentGraph(builder.guiceModules().activate(), qrConfig.restartOnDeploy()); + configurer.getNewComponentGraph(builder.guiceModules().activate(), restartOnDeploy); initializeAndActivateContainer(builder); } catch (ConfigInterruptedException e) { break; |