mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 18:35:25 +00:00
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…
x
Reference in New Issue
Block a user