summaryrefslogtreecommitdiffstats
path: root/controller-server/src
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2017-10-18 14:08:40 +0200
committerJon Bratseth <bratseth@yahoo-inc.com>2017-10-18 14:08:40 +0200
commitaed3404115f540c796294b33555b6aaa98fd53da (patch)
tree03cdb1177da31423cec2249700875dda2111376b /controller-server/src
parentdd464652142d20871f471638eca9e40933101ca5 (diff)
Catch more errors and warn
Diffstat (limited to 'controller-server/src')
-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);
}
}
}
}
}
+
}