jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chetan Mehrotra (JIRA)" <j...@apache.org>
Subject [jira] [Created] (OAK-6693) Ensure that IndexNodeManager releases lock in case of error in acquiring it
Date Thu, 21 Sep 2017 08:32:00 GMT
Chetan Mehrotra created OAK-6693:
------------------------------------

             Summary: 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


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)

Mime
View raw message