diff options
4 files changed, 16 insertions, 8 deletions
diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/Deployer.java b/config-provisioning/src/main/java/com/yahoo/config/provision/Deployer.java index 9cfe3fdd1cc..20e23edddce 100644 --- a/config-provisioning/src/main/java/com/yahoo/config/provision/Deployer.java +++ b/config-provisioning/src/main/java/com/yahoo/config/provision/Deployer.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.config.provision; import java.time.Duration; @@ -66,6 +66,9 @@ public interface Deployer { Optional<Instant> lastDeployTime(ApplicationId application); /** Whether the deployer is bootstrapping, some users of the deployer will want to hold off with deployments in that case. */ - default boolean bootstrapping() { return false; }; + default boolean bootstrapping() { return false; } + + /** Timeout in server, clients can use this to set correct client timeout */ + default Duration serverDeployTimeout() { return Duration.ofMinutes(30); } } diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java index 8ded1f4c573..157e1bd838c 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java @@ -993,6 +993,9 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye .sum(); } + @Override + public Duration serverDeployTimeout() { return Duration.ofSeconds(configserverConfig.zookeeper().barrierTimeout()); } + private static void logConfigChangeActions(ConfigChangeActions actions, DeployLogger logger) { RestartActions restartActions = actions.getRestartActions(); if ( ! restartActions.isEmpty()) { diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/NodeRepositoryMaintenance.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/NodeRepositoryMaintenance.java index f291f688aa9..1d9fd258936 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/NodeRepositoryMaintenance.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/NodeRepositoryMaintenance.java @@ -1,4 +1,4 @@ -// 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.hosted.provision.maintenance; import com.google.inject.Inject; @@ -65,7 +65,7 @@ public class NodeRepositoryMaintenance extends AbstractComponent { Zone zone, Clock clock, Orchestrator orchestrator, Metric metric, ProvisionServiceProvider provisionServiceProvider, FlagSource flagSource, NodeMetrics nodeMetrics, NodeMetricsDb nodeMetricsDb) { - DefaultTimes defaults = new DefaultTimes(zone); + DefaultTimes defaults = new DefaultTimes(zone, deployer); nodeFailer = new NodeFailer(deployer, hostLivenessTracker, serviceMonitor, nodeRepository, defaults.failGrace, defaults.nodeFailerInterval, clock, orchestrator, defaults.throttlePolicy, metric); @@ -154,7 +154,7 @@ public class NodeRepositoryMaintenance extends AbstractComponent { private final NodeFailer.ThrottlePolicy throttlePolicy; - DefaultTimes(Zone zone) { + DefaultTimes(Zone zone, Deployer deployer) { autoscalingInterval = Duration.ofMinutes(15); dynamicProvisionerInterval = Duration.ofMinutes(5); failedExpirerInterval = Duration.ofMinutes(10); @@ -171,8 +171,7 @@ public class NodeRepositoryMaintenance extends AbstractComponent { rebalancerInterval = Duration.ofMinutes(120); redeployMaintainerInterval = Duration.ofMinutes(1); // Need to be long enough for deployment to be finished for all config model versions - // Should be equal to timeout for deployments - reservationExpiry = zone.system().isCd() ? Duration.ofMinutes(5) : Duration.ofMinutes(30); + reservationExpiry = deployer.serverDeployTimeout(); scalingSuggestionsInterval = Duration.ofMinutes(31); spareCapacityMaintenanceInterval = Duration.ofMinutes(30); throttlePolicy = NodeFailer.ThrottlePolicy.hosted; diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/testutils/MockDeployer.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/testutils/MockDeployer.java index 4baaeb12167..896cd530875 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/testutils/MockDeployer.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/testutils/MockDeployer.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.hosted.provision.testutils; import com.google.inject.Inject; @@ -124,6 +124,9 @@ public class MockDeployer implements Deployer { return bootstrapping; } + @Override + public Duration serverDeployTimeout() { return Duration.ofSeconds(60); } + public void removeApplication(ApplicationId applicationId) { new MockDeployment(provisioner, new ApplicationContext(applicationId, List.of())).activate(); |