Throw EngineClosedException if engine is closed

Currently we throw misleading exception in acquireSearcher
if we try to acquire while we are failing the engine. We should
throw an EngineClosedException instead.

Relates to #5633
This commit is contained in:
Simon Willnauer 2014-04-01 16:58:13 +02:00
parent 257eddd8f0
commit 2a5ffaafcb

View File

@ -663,6 +663,7 @@ public class InternalEngine extends AbstractIndexShardComponent implements Engin
return newSearcher(source, searcher, manager); return newSearcher(source, searcher, manager);
} catch (Throwable ex) { } catch (Throwable ex) {
logger.error("failed to acquire searcher, source {}", ex, source); logger.error("failed to acquire searcher, source {}", ex, source);
ensureOpen(); // throw EngineCloseException here if we are already closed
throw new EngineException(shardId, ex.getMessage()); throw new EngineException(shardId, ex.getMessage());
} }
} }