Enrich exception message if searcher can not be aquired

This commit also moves the log message after the ensureOpen() call
to only log an error if it's really an erro condition.
This commit is contained in:
Simon Willnauer 2014-04-01 17:13:20 +02:00
parent 2a5ffaafcb
commit 1f4de9cfb5

View File

@ -662,9 +662,9 @@ public class InternalEngine extends AbstractIndexShardComponent implements Engin
IndexSearcher searcher = manager.acquire();
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());
logger.error("failed to acquire searcher, source {}", ex, source);
throw new EngineException(shardId, "failed to acquire searcher, source " + source, ex);
}
}