diff --git a/server/src/main/java/org/elasticsearch/index/shard/IndexShard.java b/server/src/main/java/org/elasticsearch/index/shard/IndexShard.java index 292467ccd7fe0..48082f1ed86ab 100644 --- a/server/src/main/java/org/elasticsearch/index/shard/IndexShard.java +++ b/server/src/main/java/org/elasticsearch/index/shard/IndexShard.java @@ -597,7 +597,11 @@ public void onFailure(Exception e) { if (state == IndexShardState.CLOSED) { // ignore, shutting down } else { - failShard("exception during primary-replica resync", e); + try { + failShard("exception during primary-replica resync", e); + } catch (AlreadyClosedException ace) { + // okay, the index was deleted + } } } });