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 080d753fec9ce..c2e43bdcf3adf 100644 --- a/server/src/main/java/org/elasticsearch/index/shard/IndexShard.java +++ b/server/src/main/java/org/elasticsearch/index/shard/IndexShard.java @@ -592,7 +592,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 + } } } });