Use scheduleWithFixedDelay instead of scheduleAtFixedRate
@@ -69,7 +69,7 @@ public class NodeAdminImpl implements NodeAdmin {
this.numberOfContainersInLoadImageState = metricReceiver.declareGauge(MetricReceiverWrapper.APPLICATION_DOCKER, dimensions, "nodes.image.loading");
this.numberOfUnhandledExceptionsInNodeAgent = metricReceiver.declareCounter(MetricReceiverWrapper.APPLICATION_DOCKER, dimensions, "nodes.unhandled_exceptions");
- metricsScheduler.scheduleAtFixedRate(() -> {
+ metricsScheduler.scheduleWithFixedDelay(() -> {
try {
nodeAgents.values().forEach(nodeAgent -> nodeAgent.updateContainerNodeMetrics(nodeAgents.size()));
} catch (Throwable e) {
@@ -77,7 +77,7 @@ public class NodeAdminImpl implements NodeAdmin {
}
}, 0, 30, TimeUnit.SECONDS);
- aclMaintainer.ifPresent(maintainer -> aclScheduler.scheduleAtFixedRate(() -> {
+ aclMaintainer.ifPresent(maintainer -> aclScheduler.scheduleWithFixedDelay(() -> {
if (!isFrozen()) maintainer.run();
}, 30, 60, TimeUnit.SECONDS));
}
