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); } }