Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
import org.elasticsearch.common.util.Maps;
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;
Expand Down Expand Up @@ -1219,7 +1220,13 @@ public void run() {
}
// Reschedule itself to run again if not closed
if (closed.get() == false) {
threadPool.schedule(this, interval, ThreadPool.Names.SAME);
try {
threadPool.schedule(this, interval, ThreadPool.Names.SAME);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

easier to use scheduleUnlessShuttingDown?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry! Didn't know about that method, will open cleanup PR in a sec.

} catch (EsRejectedExecutionException e) {
if (closed.get() == false) {
throw e;
}
}
}
}

Expand Down