Skip to content

Commit 1a706f6

Browse files
s1monwbleskes
authored andcommitted
[PING] Don't bubble up exception if we are shutting down and ping schedules get rejected
1 parent 7b35aa5 commit 1a706f6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/org/elasticsearch/discovery/zen/ping/unicast/UnicastZenPing.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import org.elasticsearch.common.unit.TimeValue;
3636
import org.elasticsearch.common.util.concurrent.ConcurrentCollections;
3737
import org.elasticsearch.common.util.concurrent.EsExecutors;
38+
import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException;
3839
import org.elasticsearch.discovery.zen.elect.ElectMasterService;
3940
import org.elasticsearch.discovery.zen.ping.PingContextProvider;
4041
import org.elasticsearch.discovery.zen.ping.ZenPing;
@@ -254,6 +255,9 @@ public void run() {
254255
}
255256
}
256257
});
258+
} catch (EsRejectedExecutionException ex) { // TODO: remove this once ScheduledExecutor has support for AbstractRunnable
259+
sendPingsHandler.close();
260+
// we are shutting down
257261
} catch (Exception e) {
258262
sendPingsHandler.close();
259263
throw new ElasticsearchException("Ping execution failed", e);

0 commit comments

Comments
 (0)