diff --git a/src/main/java/org/elasticsearch/index/engine/robin/RobinEngine.java b/src/main/java/org/elasticsearch/index/engine/robin/RobinEngine.java index e30339ce17a..0c9207acfe3 100644 --- a/src/main/java/org/elasticsearch/index/engine/robin/RobinEngine.java +++ b/src/main/java/org/elasticsearch/index/engine/robin/RobinEngine.java @@ -337,11 +337,11 @@ public class RobinEngine extends AbstractIndexShardComponent implements Engine { } } } catch (Exception e) { - searcher.release(); //TODO: A better exception goes here throw new EngineException(shardId(), "failed to load document", e); + } finally { + searcher.release(); } - searcher.release(); return GetResult.NOT_EXISTS; } finally { rwl.readLock().unlock();