summaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorTorbjørn Smørgrav <smorgrav@users.noreply.github.com>2017-10-18 14:25:44 +0200
committerGitHub <noreply@github.com>2017-10-18 14:25:44 +0200
commit9de8d3d524f8856f9bed0efc6294ace9dd3e6c08 (patch)
treef464052cf7a38f4bedd950708fabad88f82d8035 /controller-server
parent28d85c00766f18af9c9ccdcb1f9d325584146521 (diff)
parentaed3404115f540c796294b33555b6aaa98fd53da (diff)
Merge pull request #3812 from vespa-engine/bratseth/catch-missing-zone
Catch more errors and warn
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/ClusterInfoMaintainer.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/ClusterInfoMaintainer.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/ClusterInfoMaintainer.java
index c807a7f0586..baf60b612b0 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/ClusterInfoMaintainer.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/ClusterInfoMaintainer.java
@@ -18,6 +18,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
+import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
@@ -30,6 +31,8 @@ import java.util.stream.Collectors;
*/
public class ClusterInfoMaintainer extends Maintainer {
+ private static final Logger log = Logger.getLogger(ClusterInfoMaintainer.class.getName());
+
private final Controller controller;
ClusterInfoMaintainer(Controller controller, Duration duration, JobControl jobControl) {
@@ -53,7 +56,7 @@ public class ClusterInfoMaintainer extends Maintainer {
for (String id : clusters.keySet()) {
List<NodeList.Node> clusterNodes = clusters.get(id);
- //Assume they are all equal and use first node as a representatitve for the cluster
+ // Assume they are all equal and use first node as a representative for the cluster
NodeList.Node node = clusterNodes.get(0);
// Extract flavor info
@@ -73,7 +76,7 @@ public class ClusterInfoMaintainer extends Maintainer {
// Add to map
List<String> hostnames = clusterNodes.stream().map(node1 -> node1.hostname).collect(Collectors.toList());
ClusterInfo inf = new ClusterInfo(node.flavor, node.cost, cpu, mem, disk,
- ClusterSpec.Type.from(node.membership.clusterType), hostnames);
+ ClusterSpec.Type.from(node.membership.clusterType), hostnames);
infoMap.put(new ClusterSpec.Id(id), inf);
}
@@ -82,7 +85,6 @@ public class ClusterInfoMaintainer extends Maintainer {
@Override
protected void maintain() {
-
for (Application application : controller().applications().asList()) {
try (Lock lock = controller().applications().lock(application.id())) {
for (Deployment deployment : application.deployments().values()) {
@@ -92,11 +94,13 @@ public class ClusterInfoMaintainer extends Maintainer {
Map<ClusterSpec.Id, ClusterInfo> clusterInfo = getClusterInfo(nodes, deployment.zone());
Application app = application.with(deployment.withClusterInfo(clusterInfo));
controller.applications().store(app, lock);
- } catch (IOException ioe) {
- Logger.getLogger(ClusterInfoMaintainer.class.getName()).fine(ioe.getMessage());
+ }
+ catch (IOException | IllegalArgumentException e) {
+ log.log(Level.WARNING, "Failing getting cluster info of for " + deploymentId, e);
}
}
}
}
}
+
}