release searcher in finally block rather than relying on an exception that is thrown

This commit is contained in:
Simon Willnauer 2013-04-05 22:45:40 +02:00
parent 84670212a6
commit 36ffd6d582
1 changed files with 2 additions and 2 deletions

View File

@ -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();