aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java1
-rw-r--r--config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java7
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/admin/LogserverContainer.java14
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/admin/LogserverContainerCluster.java4
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerContainer.java9
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainer.java10
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomAdminV4Builder.java2
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainer.java18
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/Container.java18
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java26
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerServiceBuilder.java4
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/content/Content.java2
-rwxr-xr-xconfig-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java71
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java41
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/modelfactory/ActivatedModelsBuilder.java1
-rw-r--r--flags/src/main/java/com/yahoo/vespa/flags/PermanentFlags.java8
16 files changed, 170 insertions, 66 deletions
diff --git a/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java b/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java
index c4ff23a2c7f..0a96b3c1030 100644
--- a/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java
+++ b/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java
@@ -89,6 +89,7 @@ public interface ModelContext {
@ModelFeatureFlag(owners = {"bjorncs", "tokle"}) default List<String> allowedAthenzProxyIdentities() { return List.of(); }
@ModelFeatureFlag(owners = {"tokle"}) default boolean tenantIamRole() { return false; }
@ModelFeatureFlag(owners = {"vekterli"}) default int maxActivationInhibitedOutOfSyncGroups() { return 0; }
+ @ModelFeatureFlag(owners = {"hmusum"}) default String jvmOmitStackTraceInFastThrowOption(ClusterSpec.Type type) { return ""; }
}
/** Warning: As elsewhere in this package, do not make backwards incompatible changes that will break old config models! */
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 64fc6d1dc16..1402f728c73 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
@@ -60,6 +60,7 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea
private int metricsProxyMaxHeapSizeInMb = 256;
private int maxActivationInhibitedOutOfSyncGroups = 0;
private List<TenantSecretStore> tenantSecretStores = Collections.emptyList();
+ private String jvmOmitStackTraceInFastThrowOption;
@Override public ModelContext.FeatureFlags featureFlags() { return this; }
@Override public boolean multitenant() { return multitenant; }
@@ -100,6 +101,7 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea
@Override public int metricsProxyMaxHeapSizeInMb(ClusterSpec.Type type) { return metricsProxyMaxHeapSizeInMb; }
@Override public int maxActivationInhibitedOutOfSyncGroups() { return maxActivationInhibitedOutOfSyncGroups; }
@Override public List<TenantSecretStore> tenantSecretStores() { return tenantSecretStores; }
+ @Override public String jvmOmitStackTraceInFastThrowOption(ClusterSpec.Type type) { return jvmOmitStackTraceInFastThrowOption; }
public TestProperties setFeedConcurrency(double feedConcurrency) {
this.feedConcurrency = feedConcurrency;
@@ -241,6 +243,11 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea
return this;
}
+ public TestProperties setJvmOmitStackTraceInFastThrowOption(String value) {
+ this.jvmOmitStackTraceInFastThrowOption = value;
+ return this;
+ }
+
public static class Spec implements ConfigServerSpec {
private final String hostName;
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/admin/LogserverContainer.java b/config-model/src/main/java/com/yahoo/vespa/model/admin/LogserverContainer.java
index c2bc2494613..dbf41a4f206 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/admin/LogserverContainer.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/admin/LogserverContainer.java
@@ -1,8 +1,11 @@
-// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.admin;
+import com.yahoo.config.model.api.ModelContext;
import com.yahoo.config.model.api.container.ContainerServiceType;
+import com.yahoo.config.model.deploy.DeployState;
import com.yahoo.config.model.producer.AbstractConfigProducer;
+import com.yahoo.config.provision.ClusterSpec;
import com.yahoo.vespa.model.container.Container;
import com.yahoo.vespa.model.container.component.AccessLogComponent;
import com.yahoo.vespa.model.container.component.AccessLogComponent.AccessLogType;
@@ -14,8 +17,8 @@ import com.yahoo.vespa.model.container.component.AccessLogComponent.CompressionT
*/
public class LogserverContainer extends Container {
- public LogserverContainer(AbstractConfigProducer<?> parent, boolean isHostedVespa) {
- super(parent, "" + 0, 0, isHostedVespa);
+ public LogserverContainer(AbstractConfigProducer<?> parent, DeployState deployState) {
+ super(parent, "" + 0, 0, deployState);
LogserverContainerCluster cluster = (LogserverContainerCluster) parent;
addComponent(new AccessLogComponent(
cluster, AccessLogType.jsonAccessLog, CompressionType.GZIP, cluster.getName(), true));
@@ -31,4 +34,9 @@ public class LogserverContainer extends Container {
return "";
}
+ @Override
+ protected String jvmOmitStackTraceInFastThrowOption(ModelContext.FeatureFlags featureFlags) {
+ return featureFlags.jvmOmitStackTraceInFastThrowOption(ClusterSpec.Type.admin);
+ }
+
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/admin/LogserverContainerCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/admin/LogserverContainerCluster.java
index 43b394b7f42..439535c7bb0 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/admin/LogserverContainerCluster.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/admin/LogserverContainerCluster.java
@@ -9,8 +9,6 @@ import com.yahoo.vespa.model.container.ContainerCluster;
import com.yahoo.vespa.model.container.component.Handler;
import com.yahoo.vespa.model.container.component.SystemBindingPattern;
-import java.util.Optional;
-
/**
* @author hmusum
*/
@@ -21,7 +19,7 @@ public class LogserverContainerCluster extends ContainerCluster<LogserverContain
addDefaultHandlersWithVip();
addLogHandler();
- setJvmGCOptions(deployState.getProperties().jvmGCOptions(Optional.of(ClusterSpec.Type.admin)));
+ setJvmGCOptions(deployState.featureFlags().jvmOmitStackTraceInFastThrowOption(ClusterSpec.Type.admin));
}
@Override
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerContainer.java b/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerContainer.java
index f1717625d10..60991a59a75 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerContainer.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerContainer.java
@@ -3,9 +3,11 @@ package com.yahoo.vespa.model.admin.clustercontroller;
import com.yahoo.cloud.config.ZookeeperServerConfig;
import com.yahoo.component.ComponentSpecification;
+import com.yahoo.config.model.api.ModelContext;
import com.yahoo.config.model.api.container.ContainerServiceType;
import com.yahoo.config.model.deploy.DeployState;
import com.yahoo.config.model.producer.AbstractConfigProducer;
+import com.yahoo.config.provision.ClusterSpec;
import com.yahoo.container.bundle.BundleInstantiationSpecification;
import com.yahoo.container.core.documentapi.DocumentAccessProvider;
import com.yahoo.container.di.config.PlatformBundlesConfig;
@@ -46,7 +48,7 @@ public class ClusterControllerContainer extends Container implements
boolean runStandaloneZooKeeper,
DeployState deployState,
boolean retired) {
- super(parent, "" + index, retired, index, deployState.isHosted());
+ super(parent, "" + index, retired, index, deployState);
addHandler("clustercontroller-status",
"com.yahoo.vespa.clustercontroller.apps.clustercontroller.StatusHandler",
"/clustercontroller-status/*",
@@ -84,6 +86,11 @@ public class ClusterControllerContainer extends Container implements
return ContainerServiceType.CLUSTERCONTROLLER_CONTAINER;
}
+ @Override
+ protected String jvmOmitStackTraceInFastThrowOption(ModelContext.FeatureFlags featureFlags) {
+ return featureFlags.jvmOmitStackTraceInFastThrowOption(ClusterSpec.Type.admin);
+ }
+
private void configureZooKeeperServer(boolean runStandaloneZooKeeper) {
if (runStandaloneZooKeeper)
ContainerModelBuilder.addReconfigurableZooKeeperServerComponents(this);
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainer.java b/config-model/src/main/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainer.java
index 89182ca28ff..29ed27675ca 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainer.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainer.java
@@ -1,4 +1,4 @@
-// Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.admin.metricsproxy;
@@ -15,6 +15,7 @@ import com.yahoo.config.model.api.ModelContext;
import com.yahoo.config.model.api.container.ContainerServiceType;
import com.yahoo.config.model.deploy.DeployState;
import com.yahoo.config.provision.ClusterMembership;
+import com.yahoo.config.provision.ClusterSpec;
import com.yahoo.search.config.QrStartConfig;
import com.yahoo.vespa.model.HostResource;
import com.yahoo.vespa.model.PortAllocBridge;
@@ -50,7 +51,7 @@ public class MetricsProxyContainer extends Container implements
public MetricsProxyContainer(MetricsProxyContainerCluster cluster, HostResource host, int index, DeployState deployState) {
- super(cluster, host.getHostname(), index, deployState.isHosted());
+ super(cluster, host.getHostname(), index, deployState);
this.isHostedVespa = deployState.isHosted();
this.clusterMembership = host.spec().membership();
this.featureFlags = deployState.featureFlags();
@@ -74,6 +75,11 @@ public class MetricsProxyContainer extends Container implements
}
@Override
+ protected String jvmOmitStackTraceInFastThrowOption(ModelContext.FeatureFlags featureFlags) {
+ return featureFlags.jvmOmitStackTraceInFastThrowOption(ClusterSpec.Type.admin);
+ }
+
+ @Override
public int getWantedPort() {
return BASEPORT;
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomAdminV4Builder.java b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomAdminV4Builder.java
index a28475c94f3..2e04007e6d2 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomAdminV4Builder.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomAdminV4Builder.java
@@ -105,7 +105,7 @@ public class DomAdminV4Builder extends DomAdminBuilderBase {
ContainerModel logserverClusterModel = new ContainerModel(context.withParent(admin).withId(logServerCluster.getSubId()));
logserverClusterModel.setCluster(logServerCluster);
- LogserverContainer container = new LogserverContainer(logServerCluster, deployState.isHosted());
+ LogserverContainer container = new LogserverContainer(logServerCluster, deployState);
container.setHostResource(hostResource);
container.initService(deployState.getDeployLogger());
logServerCluster.addContainer(container);
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainer.java b/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainer.java
index fddfcabeb0e..523002afa25 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainer.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainer.java
@@ -2,8 +2,11 @@
package com.yahoo.vespa.model.container;
import com.yahoo.cloud.config.ZookeeperServerConfig;
+import com.yahoo.config.model.api.ModelContext;
import com.yahoo.config.model.api.container.ContainerServiceType;
+import com.yahoo.config.model.deploy.DeployState;
import com.yahoo.config.model.producer.AbstractConfigProducer;
+import com.yahoo.config.provision.ClusterSpec;
import com.yahoo.config.provision.NodeResources;
import com.yahoo.container.bundle.BundleInstantiationSpecification;
import com.yahoo.osgi.provider.model.ComponentModel;
@@ -24,13 +27,13 @@ public final class ApplicationContainer extends Container implements
private final boolean isHostedVespa;
- public ApplicationContainer(AbstractConfigProducer<?> parent, String name, int index, boolean isHostedVespa) {
- this(parent, name, false, index, isHostedVespa);
+ public ApplicationContainer(AbstractConfigProducer<?> parent, String name, int index, DeployState deployState) {
+ this(parent, name, false, index, deployState);
}
- public ApplicationContainer(AbstractConfigProducer<?> parent, String name, boolean retired, int index, boolean isHostedVespa) {
- super(parent, name, retired, index, isHostedVespa);
- this.isHostedVespa = isHostedVespa;
+ public ApplicationContainer(AbstractConfigProducer<?> parent, String name, boolean retired, int index, DeployState deployState) {
+ super(parent, name, retired, index, deployState);
+ this.isHostedVespa = deployState.isHosted();
addComponent(getFS4ResourcePool()); // TODO Remove when FS4 based search protocol is gone
}
@@ -81,4 +84,9 @@ public final class ApplicationContainer extends Container implements
builder.myid(index());
}
+ @Override
+ protected String jvmOmitStackTraceInFastThrowOption(ModelContext.FeatureFlags featureFlags) {
+ return featureFlags.jvmOmitStackTraceInFastThrowOption(ClusterSpec.Type.container);
+ }
+
}
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 d075e661149..cd596038137 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
@@ -1,10 +1,12 @@
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.container;
-import com.yahoo.component.ComponentId;
import com.yahoo.config.application.api.DeployLogger;
+import com.yahoo.config.model.api.ModelContext;
import com.yahoo.config.model.api.container.ContainerServiceType;
+import com.yahoo.config.model.deploy.DeployState;
import com.yahoo.config.model.producer.AbstractConfigProducer;
+import com.yahoo.config.provision.ClusterSpec;
import com.yahoo.container.ComponentsConfig;
import com.yahoo.container.QrConfig;
import com.yahoo.container.core.ContainerHttpConfig;
@@ -78,23 +80,29 @@ public abstract class Container extends AbstractService implements
private final JettyHttpServer defaultHttpServer;
- protected Container(AbstractConfigProducer<?> parent, String name, int index, boolean isHostedVespa) {
- this(parent, name, false, index, isHostedVespa);
+ protected Container(AbstractConfigProducer<?> parent, String name, int index, DeployState deployState) {
+ this(parent, name, false, index, deployState);
}
- protected Container(AbstractConfigProducer<?> parent, String name, boolean retired, int index, boolean isHostedVespa) {
+ protected Container(AbstractConfigProducer<?> parent, String name, boolean retired, int index, DeployState deployState) {
super(parent, name);
this.name = name;
this.parent = parent;
this.retired = retired;
this.index = index;
- this.defaultHttpServer = new JettyHttpServer("DefaultHttpServer", containerClusterOrNull(parent), isHostedVespa);
+ this.defaultHttpServer = new JettyHttpServer("DefaultHttpServer", containerClusterOrNull(parent), deployState.isHosted());
if (getHttp() == null) {
addChild(defaultHttpServer);
}
addBuiltinHandlers();
addChild(new SimpleComponent("com.yahoo.container.jdisc.ConfiguredApplication$ApplicationContext"));
+
+ appendJvmOptions(jvmOmitStackTraceInFastThrowOption(deployState.featureFlags()));
+ }
+
+ protected String jvmOmitStackTraceInFastThrowOption(ModelContext.FeatureFlags featureFlags) {
+ return featureFlags.jvmOmitStackTraceInFastThrowOption(ClusterSpec.Type.container);
}
void setOwner(ContainerCluster<?> owner) { this.owner = owner; }
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java
index 1cee722feaf..d03246b4e8c 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java
@@ -1,8 +1,7 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.container.xml;
import com.google.common.collect.ImmutableList;
-import com.yahoo.component.ComponentId;
import com.yahoo.component.Version;
import com.yahoo.config.application.Xml;
import com.yahoo.config.application.api.ApplicationPackage;
@@ -598,13 +597,13 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
private void addNodes(ApplicationContainerCluster cluster, Element spec, ConfigModelContext context) {
if (standaloneBuilder)
- addStandaloneNode(cluster);
+ addStandaloneNode(cluster, context.getDeployState());
else
addNodesFromXml(cluster, spec, context);
}
- private void addStandaloneNode(ApplicationContainerCluster cluster) {
- ApplicationContainer container = new ApplicationContainer(cluster, "standalone", cluster.getContainers().size(), cluster.isHostedVespa());
+ private void addStandaloneNode(ApplicationContainerCluster cluster, DeployState deployState) {
+ ApplicationContainer container = new ApplicationContainer(cluster, "standalone", cluster.getContainers().size(), deployState);
cluster.addContainers(Collections.singleton(container));
}
@@ -769,7 +768,7 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
false,
!deployState.getProperties().isBootstrap());
var hosts = hostSystem.allocateHosts(clusterSpec, capacity, log);
- return createNodesFromHosts(log, hosts, cluster);
+ return createNodesFromHosts(log, hosts, cluster, context.getDeployState());
}
else {
return singleHostContainerCluster(cluster, hostSystem.getHost(Container.SINGLENODE_CONTAINER_SERVICESPEC), context);
@@ -777,7 +776,7 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
}
private List<ApplicationContainer> singleHostContainerCluster(ApplicationContainerCluster cluster, HostResource host, ConfigModelContext context) {
- ApplicationContainer node = new ApplicationContainer(cluster, "container.0", 0, cluster.isHostedVespa());
+ ApplicationContainer node = new ApplicationContainer(cluster, "container.0", 0, context.getDeployState());
node.setHostResource(host);
node.initService(context.getDeployLogger());
return List.of(node);
@@ -790,7 +789,7 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
ClusterSpec.Id.from(cluster.getName()),
log,
hasZooKeeper(containerElement));
- return createNodesFromHosts(context.getDeployLogger(), hosts, cluster);
+ return createNodesFromHosts(context.getDeployLogger(), hosts, cluster, context.getDeployState());
}
private List<ApplicationContainer> createNodesFromNodeType(ApplicationContainerCluster cluster, Element nodesElement, ConfigModelContext context) {
@@ -802,7 +801,7 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
Map<HostResource, ClusterMembership> hosts =
cluster.getRoot().hostSystem().allocateHosts(clusterSpec,
Capacity.fromRequiredNodeType(type), log);
- return createNodesFromHosts(context.getDeployLogger(), hosts, cluster);
+ return createNodesFromHosts(context.getDeployLogger(), hosts, cluster, context.getDeployState());
}
private List<ApplicationContainer> createNodesFromContentServiceReference(ApplicationContainerCluster cluster, Element nodesElement, ConfigModelContext context) {
@@ -820,14 +819,17 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
referenceId,
cluster.getRoot().hostSystem(),
context.getDeployLogger());
- return createNodesFromHosts(context.getDeployLogger(), hosts, cluster);
+ return createNodesFromHosts(context.getDeployLogger(), hosts, cluster, context.getDeployState());
}
- private List<ApplicationContainer> createNodesFromHosts(DeployLogger deployLogger, Map<HostResource, ClusterMembership> hosts, ApplicationContainerCluster cluster) {
+ private List<ApplicationContainer> createNodesFromHosts(DeployLogger deployLogger,
+ Map<HostResource, ClusterMembership> hosts,
+ ApplicationContainerCluster cluster,
+ DeployState deployState) {
List<ApplicationContainer> nodes = new ArrayList<>();
for (Map.Entry<HostResource, ClusterMembership> entry : hosts.entrySet()) {
String id = "container." + entry.getValue().index();
- ApplicationContainer container = new ApplicationContainer(cluster, id, entry.getValue().retired(), entry.getValue().index(), cluster.isHostedVespa());
+ ApplicationContainer container = new ApplicationContainer(cluster, id, entry.getValue().retired(), entry.getValue().index(), deployState);
container.setHostResource(entry.getKey());
container.initService(deployLogger);
nodes.add(container);
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerServiceBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerServiceBuilder.java
index 3fae9d52929..78469bdf51c 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerServiceBuilder.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerServiceBuilder.java
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.container.xml;
import com.yahoo.config.model.deploy.DeployState;
@@ -22,7 +22,7 @@ public class ContainerServiceBuilder extends VespaDomBuilder.DomConfigProducerBu
@Override
protected ApplicationContainer doBuild(DeployState deployState, AbstractConfigProducer<?> parent, Element nodeElem) {
- return new ApplicationContainer(parent, id, index, deployState.isHosted());
+ return new ApplicationContainer(parent, id, index, deployState);
}
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/Content.java b/config-model/src/main/java/com/yahoo/vespa/model/content/Content.java
index b93f4405333..2bd9cb09aa6 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/content/Content.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/content/Content.java
@@ -299,7 +299,7 @@ public class Content extends ConfigModel {
if (!processedHosts.contains(host)) {
String containerName = String.valueOf(searchNode.getDistributionKey());
ApplicationContainer docprocService = new ApplicationContainer(indexingCluster, containerName, index,
- modelContext.getDeployState().isHosted());
+ modelContext.getDeployState());
index++;
docprocService.useDynamicPorts();
docprocService.setHostResource(host);
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java
index 23c37666257..46026a5528c 100755
--- a/config-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java
@@ -76,7 +76,7 @@ public class ContainerClusterTest {
.zone(new Zone(SystemName.cd, Environment.test, RegionName.from("some-region")))
.build();
MockRoot root = new MockRoot("foo", state);
- ContainerCluster cluster = new ApplicationContainerCluster(root, "container0", "container1", state);
+ ContainerCluster<?> cluster = new ApplicationContainerCluster(root, "container0", "container1", state);
ConfigserverConfig.Builder builder = new ConfigserverConfig.Builder();
cluster.getConfig(builder);
ConfigserverConfig config = new ConfigserverConfig(builder);
@@ -101,10 +101,14 @@ public class ContainerClusterTest {
}
private MockRoot createRoot(boolean isHosted) {
DeployState state = new DeployState.Builder().properties(new TestProperties().setHostedVespa(isHosted)).build();
- return new MockRoot("foo", state);
+ return createRoot(state);
+ }
+ private MockRoot createRoot(DeployState deployState) {
+ return new MockRoot("foo", deployState);
}
- private void verifyHeapSizeAsPercentageOfPhysicalMemory(boolean isHosted, boolean isCombinedCluster,
+ private void verifyHeapSizeAsPercentageOfPhysicalMemory(boolean isHosted,
+ boolean isCombinedCluster,
Integer explicitMemoryPercentage,
int expectedMemoryPercentage) {
ContainerCluster<?> cluster = createContainerCluster(createRoot(isHosted), isCombinedCluster, explicitMemoryPercentage);
@@ -147,7 +151,7 @@ public class ContainerClusterTest {
if (hasDocProc) {
cluster.setDocproc(new ContainerDocproc(cluster, null));
}
- addContainer(root.deployLogger(), cluster, "c1", "host-c1");
+ addContainer(root, cluster, "c1", "host-c1");
assertEquals(1, cluster.getContainers().size());
ApplicationContainer container = cluster.getContainers().get(0);
verifyJvmArgs(isHosted, hasDocProc, "", container.getJvmOptions());
@@ -205,10 +209,28 @@ public class ContainerClusterTest {
}
@Test
- public void requireThatWeCanhandleNull() {
+ public void requireThatJvmOmitStackTraceInFastThrowOptionWorks() {
+ // Empty option if option not set in property
+ MockRoot root = createRoot(new DeployState.Builder().build());
+ ApplicationContainerCluster cluster = createContainerCluster(root, false);
+ addContainer(root, cluster, "c1", "host-c1");
+ ApplicationContainer container = cluster.getContainers().get(0);
+ assertEquals("", container.getJvmOptions());
+
+ String jvmOption = "-XX:-foo";
+ DeployState deployState = new DeployState.Builder().properties(new TestProperties().setJvmOmitStackTraceInFastThrowOption(jvmOption)).build();
+ root = createRoot(deployState);
+ cluster = createContainerCluster(root, false);
+ addContainer(root, cluster, "c1", "host-c1");
+ container = cluster.getContainers().get(0);
+ assertEquals(jvmOption, container.getJvmOptions());
+ }
+
+ @Test
+ public void requireThatWeCanHandleNull() {
MockRoot root = createRoot(false);
ApplicationContainerCluster cluster = createContainerCluster(root, false);
- addContainer(root.deployLogger(), cluster, "c1", "host-c1");
+ addContainer(root, cluster, "c1", "host-c1");
Container container = cluster.getContainers().get(0);
container.setJvmOptions("");
String empty = container.getJvmOptions();
@@ -220,7 +242,7 @@ public class ContainerClusterTest {
public void requireThatPoolAndQueueCanNotBeControlledByPropertiesWhenNoFlavor() {
MockRoot root = new MockRoot("foo");
ApplicationContainerCluster cluster = createContainerCluster(root, false);
- addContainer(root.deployLogger(), cluster, "c1", "host-c1");
+ addContainer(root, cluster, "c1", "host-c1");
root.freezeModelTopology();
ThreadpoolConfig threadpoolConfig = root.getConfig(ThreadpoolConfig.class, "container0/component/default-threadpool");
@@ -232,7 +254,7 @@ public class ContainerClusterTest {
public void requireThatDefaultThreadPoolConfigIsSane() {
MockRoot root = new MockRoot("foo");
ApplicationContainerCluster cluster = createContainerCluster(root, false);
- addContainer(root.deployLogger(), cluster, "c1", "host-c1");
+ addContainer(root, cluster, "c1", "host-c1");
root.freezeModelTopology();
ThreadpoolConfig threadpoolConfig = root.getConfig(ThreadpoolConfig.class, "container0/component/default-threadpool");
@@ -244,7 +266,7 @@ public class ContainerClusterTest {
public void container_cluster_has_default_threadpool_provider() {
MockRoot root = new MockRoot("foo");
ApplicationContainerCluster cluster = createContainerCluster(root, false);
- addContainer(root.deployLogger(), cluster, "c1", "host-c1");
+ addContainer(root, cluster, "c1", "host-c1");
root.freezeModelTopology();
ComponentId expectedComponentId = new ComponentId("default-threadpool");
@@ -267,7 +289,7 @@ public class ContainerClusterTest {
HostResource hostResource = new HostResource(
new Host(null, "host-c1"),
hostProvisioner.allocateHost("host-c1"));
- addContainerWithHostResource(root.deployLogger(), cluster, "c1", hostResource);
+ addContainerWithHostResource(root, cluster, "c1", hostResource);
root.freezeModelTopology();
ThreadpoolConfig threadpoolConfig = root.getConfig(ThreadpoolConfig.class, "container0/component/default-threadpool");
@@ -288,7 +310,7 @@ public class ContainerClusterTest {
HostResource hostResource = new HostResource(
new Host(null, "host-c1"),
hostProvisioner.allocateHost("host-c1"));
- addContainerWithHostResource(root.deployLogger(), cluster, "c1", hostResource);
+ addContainerWithHostResource(root, cluster, "c1", hostResource);
root.freezeModelTopology();
ServerConfig cfg = root.getConfig(ServerConfig.class, "container0/c1/DefaultHttpServer");
@@ -316,8 +338,8 @@ public class ContainerClusterTest {
DeployState state = new DeployState.Builder().build();
MockRoot root = new MockRoot("foo", state);
var cluster = new ApplicationContainerCluster(root, "container", "search-cluster", state);
- addContainer(root.deployLogger(), cluster, "c1", "host-c1");
- addContainer(root.deployLogger(), cluster, "c2", "host-c2");
+ addContainer(root, cluster, "c1", "host-c1");
+ addContainer(root, cluster, "c2", "host-c2");
CuratorConfig.Builder configBuilder = new CuratorConfig.Builder();
cluster.getConfig(configBuilder);
CuratorConfig config = configBuilder.build();
@@ -331,9 +353,9 @@ public class ContainerClusterTest {
DeployState state = new DeployState.Builder().build();
MockRoot root = new MockRoot("foo", state);
var cluster = new ApplicationContainerCluster(root, "container", "search-cluster", state);
- addContainer(root.deployLogger(), cluster, "c1", "host-c1");
- addContainer(root.deployLogger(), cluster, "c2", "host-c2");
- addContainer(root.deployLogger(), cluster, "c3", "host-c3");
+ addContainer(root, cluster, "c1", "host-c1");
+ addContainer(root, cluster, "c2", "host-c2");
+ addContainer(root, cluster, "c3", "host-c3");
// Only myid is set for container
ZookeeperServerConfig.Builder configBuilder = new ZookeeperServerConfig.Builder();
@@ -368,14 +390,17 @@ public class ContainerClusterTest {
}
- private static void addContainer(DeployLogger deployLogger, ApplicationContainerCluster cluster, String name, String hostName) {
- addContainerWithHostResource(deployLogger, cluster, name, new HostResource(new Host(null, hostName)));
+ private static void addContainer(MockRoot root, ApplicationContainerCluster cluster, String name, String hostName) {
+ addContainerWithHostResource(root, cluster, name, new HostResource(new Host(null, hostName)));
}
- private static void addContainerWithHostResource(DeployLogger deployLogger, ApplicationContainerCluster cluster, String name, HostResource hostResource) {
- ApplicationContainer container = new ApplicationContainer(cluster, name, 0, cluster.isHostedVespa());
+ private static void addContainerWithHostResource(MockRoot root,
+ ApplicationContainerCluster cluster,
+ String name,
+ HostResource hostResource) {
+ ApplicationContainer container = new ApplicationContainer(cluster, name, 0, root.getDeployState());
container.setHostResource(hostResource);
- container.initService(deployLogger);
+ container.initService(root.deployLogger());
cluster.addContainer(container);
}
@@ -393,8 +418,8 @@ public class ContainerClusterTest {
DeployState deployState = DeployState.createTestState();
MockRoot root = new MockRoot("foo", deployState);
ApplicationContainerCluster cluster = new ApplicationContainerCluster(root, "subId", "name", deployState);
- addContainer(deployState.getDeployLogger(), cluster, "c1", "host-c1");
- addContainer(deployState.getDeployLogger(), cluster, "c2", "host-c2");
+ addContainer(root, cluster, "c1", "host-c1");
+ addContainer(root, cluster, "c2", "host-c2");
return cluster;
}
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java b/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java
index 490e82ff10a..a1a8548f5f1 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java
@@ -17,6 +17,7 @@ import com.yahoo.config.model.api.ModelContext;
import com.yahoo.config.model.api.Provisioned;
import com.yahoo.config.model.api.Quota;
import com.yahoo.config.model.api.Reindexing;
+import com.yahoo.config.model.api.TenantSecretStore;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.config.provision.AthenzDomain;
import com.yahoo.config.provision.ClusterSpec;
@@ -25,7 +26,6 @@ import com.yahoo.config.provision.HostName;
import com.yahoo.config.provision.NodeResources;
import com.yahoo.config.provision.TenantName;
import com.yahoo.config.provision.Zone;
-import com.yahoo.config.model.api.TenantSecretStore;
import com.yahoo.container.jdisc.secretstore.SecretStore;
import com.yahoo.vespa.config.server.tenant.SecretStoreExternalIdRetriever;
import com.yahoo.vespa.flags.FetchVector;
@@ -37,12 +37,9 @@ import com.yahoo.vespa.flags.UnboundFlag;
import java.io.File;
import java.net.URI;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import java.util.Optional;
import java.util.Set;
-import java.util.function.Function;
import java.util.function.ToIntFunction;
import static com.yahoo.vespa.config.server.ConfigServerSpec.fromConfig;
@@ -181,6 +178,7 @@ public class ModelContextImpl implements ModelContext {
private final List<String> allowedAthenzProxyIdentities;
private final boolean tenantIamRole;
private final int maxActivationInhibitedOutOfSyncGroups;
+ private final ToIntFunction<ClusterSpec.Type> jvmOmitStackTraceInFastThrow;
public FeatureFlags(FlagSource source, ApplicationId appId) {
this.dedicatedClusterControllerFlavor = parseDedicatedClusterControllerFlavor(flagValue(source, appId, Flags.DEDICATED_CLUSTER_CONTROLLER_FLAVOR));
@@ -205,6 +203,7 @@ public class ModelContextImpl implements ModelContext {
this.allowedAthenzProxyIdentities = flagValue(source, appId, Flags.ALLOWED_ATHENZ_PROXY_IDENTITIES);
this.tenantIamRole = flagValue(source, appId.tenant(), Flags.TENANT_IAM_ROLE);
this.maxActivationInhibitedOutOfSyncGroups = flagValue(source, appId, Flags.MAX_ACTIVATION_INHIBITED_OUT_OF_SYNC_GROUPS);
+ this.jvmOmitStackTraceInFastThrow = type -> flagValueAsInt(source, appId, type, PermanentFlags.JVM_OMIT_STACK_TRACE_IN_FAST_THROW);
}
@Override public Optional<NodeResources> dedicatedClusterControllerFlavor() { return Optional.ofNullable(dedicatedClusterControllerFlavor); }
@@ -229,6 +228,9 @@ public class ModelContextImpl implements ModelContext {
@Override public List<String> allowedAthenzProxyIdentities() { return allowedAthenzProxyIdentities; }
@Override public boolean tenantIamRole() { return tenantIamRole; }
@Override public int maxActivationInhibitedOutOfSyncGroups() { return maxActivationInhibitedOutOfSyncGroups; }
+ @Override public String jvmOmitStackTraceInFastThrowOption(ClusterSpec.Type type) {
+ return translateJvmOmitStackTraceInFastThrowIntToString(jvmOmitStackTraceInFastThrow, type);
+ }
private static <V> V flagValue(FlagSource source, ApplicationId appId, UnboundFlag<? extends V, ?, ?> flag) {
return flag.bindTo(source)
@@ -242,6 +244,28 @@ public class ModelContextImpl implements ModelContext {
.boxedValue();
}
+ private static <V> V flagValue(FlagSource source,
+ ApplicationId appId,
+ ClusterSpec.Type clusterType,
+ UnboundFlag<? extends V, ?, ?> flag) {
+ return flag.bindTo(source)
+ .with(FetchVector.Dimension.APPLICATION_ID, appId.serializedForm())
+ .with(FetchVector.Dimension.CLUSTER_TYPE, clusterType.name())
+ .boxedValue();
+ }
+
+ static int flagValueAsInt(FlagSource source,
+ ApplicationId appId,
+ ClusterSpec.Type clusterType,
+ UnboundFlag<? extends Boolean, ?, ?> flag) {
+ return flagValue(source, appId, clusterType, flag) ? 1 : 0;
+ }
+
+ private String translateJvmOmitStackTraceInFastThrowIntToString(ToIntFunction<ClusterSpec.Type> function,
+ ClusterSpec.Type clusterType) {
+ return function.applyAsInt(clusterType) == 1 ? "" : "-XX:-OmitStackTraceInFastThrow";
+ }
+
}
public static class Properties implements ModelContext.Properties {
@@ -359,8 +383,13 @@ public class ModelContextImpl implements ModelContext {
}
@Override public String jvmGCOptions(Optional<ClusterSpec.Type> clusterType) {
- return clusterType.map(type -> jvmGCOptionsFlag.with(CLUSTER_TYPE, type.name()))
- .orElse(jvmGCOptionsFlag)
+ return flagValueForClusterType(jvmGCOptionsFlag, clusterType);
+ }
+
+
+ public String flagValueForClusterType(StringFlag flag, Optional<ClusterSpec.Type> clusterType) {
+ return clusterType.map(type -> flag.with(CLUSTER_TYPE, type.name()))
+ .orElse(flag)
.value();
}
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/modelfactory/ActivatedModelsBuilder.java b/configserver/src/main/java/com/yahoo/vespa/config/server/modelfactory/ActivatedModelsBuilder.java
index cfc47223b11..da720ca8cb9 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/modelfactory/ActivatedModelsBuilder.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/modelfactory/ActivatedModelsBuilder.java
@@ -32,7 +32,6 @@ import com.yahoo.vespa.config.server.tenant.ApplicationRolesStore;
import com.yahoo.vespa.config.server.tenant.ContainerEndpointsCache;
import com.yahoo.vespa.config.server.tenant.EndpointCertificateMetadataStore;
import com.yahoo.vespa.config.server.tenant.EndpointCertificateRetriever;
-import com.yahoo.vespa.config.server.tenant.SecretStoreExternalIdRetriever;
import com.yahoo.vespa.config.server.tenant.TenantListener;
import com.yahoo.vespa.config.server.tenant.TenantRepository;
import com.yahoo.vespa.curator.Curator;
diff --git a/flags/src/main/java/com/yahoo/vespa/flags/PermanentFlags.java b/flags/src/main/java/com/yahoo/vespa/flags/PermanentFlags.java
index 59a2796b508..7099124024b 100644
--- a/flags/src/main/java/com/yahoo/vespa/flags/PermanentFlags.java
+++ b/flags/src/main/java/com/yahoo/vespa/flags/PermanentFlags.java
@@ -35,7 +35,7 @@ public class PermanentFlags {
public static final UnboundStringFlag JVM_GC_OPTIONS = defineStringFlag(
"jvm-gc-options", "",
- "Sets deafult jvm gc options",
+ "Sets default jvm gc options",
"Takes effect at redeployment",
ZONE_ID, APPLICATION_ID);
@@ -137,6 +137,12 @@ public class PermanentFlags {
"Takes effect on next api request"
);
+ public static final UnboundBooleanFlag JVM_OMIT_STACK_TRACE_IN_FAST_THROW = defineFeatureFlag(
+ "jvm-omit-stack-trace-in-fast-throw", true,
+ "Controls JVM option OmitStackTraceInFastThrow (default feature flag value is true, which is the default JVM option value as well)",
+ "takes effect on JVM restart",
+ NODE_TYPE, APPLICATION_ID);
+
private PermanentFlags() {}
private static UnboundBooleanFlag defineFeatureFlag(