|
@@ -60,6 +60,7 @@ import org.elasticsearch.common.unit.TimeValue;
|
|
|
import org.elasticsearch.common.util.BigArrays;
|
|
|
import org.elasticsearch.common.util.concurrent.AbstractLifecycleRunnable;
|
|
|
import org.elasticsearch.common.util.concurrent.AbstractRunnable;
|
|
|
+import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException;
|
|
|
import org.elasticsearch.common.util.concurrent.KeyedLock;
|
|
|
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
|
|
import org.elasticsearch.indices.breaker.CircuitBreakerService;
|
|
@@ -89,6 +90,7 @@ import java.util.Objects;
|
|
|
import java.util.Set;
|
|
|
import java.util.concurrent.ConcurrentMap;
|
|
|
import java.util.concurrent.CountDownLatch;
|
|
|
+import java.util.concurrent.RejectedExecutionException;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
@@ -282,7 +284,15 @@ public abstract class TcpTransport<Channel> extends AbstractLifecycleComponent i
|
|
|
|
|
|
@Override
|
|
|
protected void onAfterInLifecycle() {
|
|
|
- threadPool.schedule(pingSchedule, ThreadPool.Names.GENERIC, this);
|
|
|
+ try {
|
|
|
+ threadPool.schedule(pingSchedule, ThreadPool.Names.GENERIC, this);
|
|
|
+ } catch (EsRejectedExecutionException ex) {
|
|
|
+ if (ex.isExecutorShutdown()) {
|
|
|
+ logger.debug("couldn't schedule new ping execution, executor is shutting down", ex);
|
|
|
+ } else {
|
|
|
+ throw ex;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|