diff options
author | Harald Musum <musum@verizonmedia.com> | 2020-10-19 12:05:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-19 12:05:54 +0200 |
commit | 5ce5f12a15579eba51588071fa4293a24e510519 (patch) | |
tree | 9cacd2c85cba0c7899fd2cb2f02566131f9704cc /node-repository/src | |
parent | 93dab00e78bc0e841f073625d02aec68f81a0cbf (diff) | |
parent | 6411bc37b6a7000ffadbd13fb1ea7b53dedca47d (diff) |
Merge pull request #14942 from vespa-engine/hmusum/make-reservation-expiry-depend-on-deployment-timeout
Use deploy timeout in config server to set reservation expiry
Diffstat (limited to 'node-repository/src')
2 files changed, 8 insertions, 6 deletions
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 660a7b1f774..529f3d9afa8 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; @@ -66,7 +66,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); @@ -157,7 +157,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); @@ -175,8 +175,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); switchRebalancerInterval = Duration.ofHours(1); 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 f7d4a130626..a5522a93a6e 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; @@ -125,6 +125,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(); |