summaryrefslogtreecommitdiffstats
path: root/node-repository
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@verizonmedia.com>2020-01-15 12:16:35 +0100
committerJon Bratseth <bratseth@verizonmedia.com>2020-01-15 12:16:35 +0100
commitdc71d1f9878ec9b32a5432409a2a1f3beadab289 (patch)
treeaec99acf7db6a952891ddf3d6f135e5253be27cc /node-repository
parente42294b01c863ca4ba0986f3e52f568dd746f797 (diff)
Fail deployment if the wrong web service port is configured
This will cause the application to become unavailable so it is not sufficient to emit a warning.
Diffstat (limited to 'node-repository')
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/NodeRebooter.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/NodeRebooter.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/NodeRebooter.java
index a54287ed082..acba6b46897 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/NodeRebooter.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/NodeRebooter.java
@@ -41,7 +41,7 @@ public class NodeRebooter extends Maintainer {
@Override
protected void maintain() {
- // Reboot candidates: Nodes in long-term states, which we know can safely orchestrate a reboot
+ // Reboot candidates: Nodes in long-term states, where we know can safely orchestrate a reboot
List<Node> nodesToReboot = nodeRepository().getNodes(Node.State.active, Node.State.ready).stream()
.filter(node -> node.flavor().getType() != Flavor.Type.DOCKER_CONTAINER)
.filter(this::shouldReboot)
@@ -66,13 +66,11 @@ public class NodeRebooter extends Maintainer {
if (overdue.isEmpty()) // should never happen as all !docker-container should have provisioned timestamp
return random.nextDouble() < interval().getSeconds() / (double) rebootInterval.getSeconds();
- if (overdue.get().isNegative())
- return false;
+ if (overdue.get().isNegative()) return false;
// Use a probability such that each maintain() schedules the same number of reboots,
// as long as 0 <= overdue <= rebootInterval, with the last maintain() in that interval
// naturally scheduling the remaining with probability 1.
-
int configServers = nodeRepository().database().cluster().size();
long secondsRemaining = Math.max(0, rebootInterval.getSeconds() - overdue.get().getSeconds());
double runsRemaining = configServers * secondsRemaining / (double) interval().getSeconds();