diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/shard/service/InternalIndexShard.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/shard/service/InternalIndexShard.java index 6f0d7398cb7..fe5c4a82fea 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/shard/service/InternalIndexShard.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/shard/service/InternalIndexShard.java @@ -629,7 +629,9 @@ public class InternalIndexShard extends AbstractIndexShardComponent implements I } catch (EngineClosedException e) { // we are being closed, ignore } catch (OptimizeFailedEngineException e) { - if (e.getCause() instanceof InterruptedException) { + if (e.getCause() instanceof EngineClosedException) { + // ignore, we are being shutdown + } else if (e.getCause() instanceof InterruptedException) { // ignore, we are being shutdown } else if (e.getCause() instanceof ClosedByInterruptException) { // ignore, we are being shutdown