From 62a28921e84de79d25828911a0214ac7e0ccdc3b Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Tue, 25 Jun 2019 13:04:04 +0200 Subject: [PATCH] Cleanup IndicesService#CacheCleaner Scheduling (#42060) (#43528) * Follow up to #42016 --- .../java/org/elasticsearch/indices/IndicesService.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/indices/IndicesService.java b/server/src/main/java/org/elasticsearch/indices/IndicesService.java index 22504eee50a..4253d15df49 100644 --- a/server/src/main/java/org/elasticsearch/indices/IndicesService.java +++ b/server/src/main/java/org/elasticsearch/indices/IndicesService.java @@ -65,7 +65,6 @@ import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.concurrent.AbstractRefCounted; import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; import org.elasticsearch.common.util.iterable.Iterables; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; import org.elasticsearch.common.xcontent.NamedXContentRegistry; @@ -1226,13 +1225,7 @@ public class IndicesService extends AbstractLifecycleComponent } // Reschedule itself to run again if not closed if (closed.get() == false) { - try { - threadPool.schedule(this, interval, ThreadPool.Names.SAME); - } catch (EsRejectedExecutionException e) { - if (closed.get() == false) { - throw e; - } - } + threadPool.scheduleUnlessShuttingDown(interval, ThreadPool.Names.SAME, this); } }