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) {
|
} catch (Exception e) {
|
||||||
searcher.release();
|
|
||||||
//TODO: A better exception goes here
|
//TODO: A better exception goes here
|
||||||
throw new EngineException(shardId(), "failed to load document", e);
|
throw new EngineException(shardId(), "failed to load document", e);
|
||||||
|
} finally {
|
||||||
|
searcher.release();
|
||||||
}
|
}
|
||||||
searcher.release();
|
|
||||||
return GetResult.NOT_EXISTS;
|
return GetResult.NOT_EXISTS;
|
||||||
} finally {
|
} finally {
|
||||||
rwl.readLock().unlock();
|
rwl.readLock().unlock();
|
||||||
|
|
Loading…
Reference in New Issue