[
https://issues.apache.org/jira/browse/OAK-6693?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16175957#comment-16175957
]
Chetan Mehrotra commented on OAK-6693:
--------------------------------------
Merged to
* 1.6 with 1809258.
*
Does not need backport to older branches as lock release does not involve any
other work
> Ensure that IndexNodeManager releases lock in case of error in acquiring it
> ---------------------------------------------------------------------------
>
> Key: OAK-6693
> URL: https://issues.apache.org/jira/browse/OAK-6693
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: lucene
> Reporter: Chetan Mehrotra
> Assignee: Chetan Mehrotra
> Fix For: 1.8, 1.7.8, 1.6.6
>
>
> Currently IndexNodeManager acquires the lock like below. Here if any
> exception occurs in IndexNodeImpl then lock would remain acquired
> {noformat}
> IndexNode acquire() {
> lock.readLock().lock();
> if (closed) {
> lock.readLock().unlock();
> return null;
> } else {
> boolean success = false;
> try {
> refreshPolicy.refreshOnReadIfRequired(refreshCallback);
> success = true;
> return new IndexNodeImpl(searcherHolder);
> } finally {
> if (!success) {
> lock.readLock().unlock();
> }
> }
> }
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)