diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-09-25 16:02:12 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-09-25 16:02:12 +0200 |
commit | 0d44342bf9fa0b89b8358dddb8c9027ac4fa07a7 (patch) | |
tree | bf95ff81dbe5fc90f2384f7fda204247091c9b22 /config-model/src/main/java/com/yahoo | |
parent | 799d41556bea27116fb328524c6812ff7401636e (diff) |
Add featureflag control of container shutdown.
Diffstat (limited to 'config-model/src/main/java/com/yahoo')
-rw-r--r-- | config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java | 13 | ||||
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/container/Container.java | 8 |
2 files changed, 19 insertions, 2 deletions
diff --git a/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java b/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java index 4bf20e75a5d..dea6b980692 100644 --- a/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java +++ b/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java @@ -63,6 +63,8 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea private double resourceLimitDisk = 0.8; private double resourceLimitMemory = 0.8; private double minNodeRatioPerGroup = 0.0; + private boolean containerDumpHeapOnShutdownTimeout = false; + private double containerShutdownTimeout = 50.0; @Override public ModelContext.FeatureFlags featureFlags() { return this; } @Override public boolean multitenant() { return multitenant; } @@ -106,7 +108,16 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea @Override public double minNodeRatioPerGroup() { return minNodeRatioPerGroup; } @Override public int metricsproxyNumThreads() { return 1; } @Override public boolean enforceRankProfileInheritance() { return enforceRankProfileInheritance; } - + @Override public double containerShutdownTimeout() { return containerShutdownTimeout; } + @Override public boolean containerDumpHeapOnShutdownTimeout() { return containerDumpHeapOnShutdownTimeout; } + public TestProperties containerDumpHeapOnShutdownTimeout(boolean value) { + containerDumpHeapOnShutdownTimeout = value; + return this; + } + public TestProperties containerShutdownTimeout(double value) { + containerShutdownTimeout = value; + return this; + } public TestProperties enforceRankProfileInheritance(boolean value) { enforceRankProfileInheritance = value; return this; diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/Container.java b/config-model/src/main/java/com/yahoo/vespa/model/container/Container.java index b915453b593..cdf8d592391 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/Container.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/Container.java @@ -74,6 +74,8 @@ public abstract class Container extends AbstractService implements private final boolean retired; /** The unique index of this node */ private final int index; + private final boolean dumpHeapOnShutdownTimeout; + private final double shutdownTimeoutS; private final ComponentGroup<Handler<?>> handlers = new ComponentGroup<>(this, "handler"); private final ComponentGroup<Component<?, ?>> components = new ComponentGroup<>(this, "components"); @@ -90,6 +92,8 @@ public abstract class Container extends AbstractService implements this.parent = parent; this.retired = retired; this.index = index; + dumpHeapOnShutdownTimeout = deployState.featureFlags().containerDumpHeapOnShutdownTimeout(); + shutdownTimeoutS = deployState.featureFlags().containerShutdownTimeout(); this.defaultHttpServer = new JettyHttpServer("DefaultHttpServer", containerClusterOrNull(parent), deployState.isHosted()); if (getHttp() == null) { addChild(defaultHttpServer); @@ -315,7 +319,9 @@ public abstract class Container extends AbstractService implements .slobrokId(serviceSlobrokId())) .filedistributor(filedistributorConfig()) .discriminator((clusterName != null ? clusterName + "." : "" ) + name) - .nodeIndex(index); + .nodeIndex(index) + .shutdown.dumpHeapOnTimeout(dumpHeapOnShutdownTimeout) + .timeout(shutdownTimeoutS); } /** Returns the jvm args set explicitly for this node */ |