release searcher in finally block rather than relying on an exception that is thrown
This commit is contained in:
parent
84670212a6
commit
36ffd6d582
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue