diff --git a/src/main/java/org/elasticsearch/index/engine/internal/InternalEngine.java b/src/main/java/org/elasticsearch/index/engine/internal/InternalEngine.java index b6a6ea2bacc..9f2c7921b4b 100644 --- a/src/main/java/org/elasticsearch/index/engine/internal/InternalEngine.java +++ b/src/main/java/org/elasticsearch/index/engine/internal/InternalEngine.java @@ -663,6 +663,7 @@ public class InternalEngine extends AbstractIndexShardComponent implements Engin return newSearcher(source, searcher, manager); } catch (Throwable ex) { logger.error("failed to acquire searcher, source {}", ex, source); + ensureOpen(); // throw EngineCloseException here if we are already closed throw new EngineException(shardId, ex.getMessage()); } }