diff options
author | valerijf <valerijf@yahoo-inc.com> | 2016-10-07 14:26:07 +0200 |
---|---|---|
committer | valerijf <valerijf@yahoo-inc.com> | 2016-10-07 14:26:07 +0200 |
commit | 18f67bab0b1ab1a672da17c04b45df43f2a2e8a4 (patch) | |
tree | 51d30618120688655c5831b2b11607dd7353ed84 /node-admin | |
parent | aabbec686c3c5af9df3c96aaba01ef9cc52b9fe7 (diff) |
Fixed try/catch on scheduler
Diffstat (limited to 'node-admin')
-rw-r--r-- | node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImpl.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImpl.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImpl.java index dc7fa8c59d8..15a33dddd3c 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImpl.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImpl.java @@ -82,12 +82,13 @@ public class NodeAdminImpl implements NodeAdmin { this.numberOfContainersInLoadImageState = metricReceiver.declareGauge(dimensions, "nodes.image.loading"); this.numberOfUnhandledExceptionsInNodeAgent = metricReceiver.declareCounter(dimensions, "nodes.unhandled_exceptions"); - try { - metricsFetcherScheduler.scheduleWithFixedDelay( - () -> nodeAgents.values().forEach(NodeAgent::updateContainerNodeMetrics), 0, 30000, MILLISECONDS); - } catch (Throwable e) { - logger.warning("Metric fetcher scheduler failed", e); - } + metricsFetcherScheduler.scheduleWithFixedDelay(() -> { + try { + nodeAgents.values().forEach(NodeAgent::updateContainerNodeMetrics); + } catch (Throwable e) { + logger.warning("Metric fetcher scheduler failed", e); + } + }, 0, 30000, MILLISECONDS); } public void refreshContainersToRun(final List<ContainerNodeSpec> containersToRun) { |