You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Chetan Mehrotra (JIRA)" <ji...@apache.org> on 2017/02/14 08:20:41 UTC

[jira] [Created] (OAK-5649) Error in RefreshPolicy can lead to IndexNode lock leak

Chetan Mehrotra created OAK-5649:
------------------------------------

             Summary: Error in RefreshPolicy can lead to IndexNode lock leak
                 Key: OAK-5649
                 URL: https://issues.apache.org/jira/browse/OAK-5649
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: lucene
            Reporter: Chetan Mehrotra
            Assignee: Chetan Mehrotra
             Fix For: 1.7.0, 1.8, 1.6.1


{{IndexNode}} uses a ReadWriteLock which is "acquired" and "released". 

{code}
 boolean acquire() {
        lock.readLock().lock();
        if (closed) {
            lock.readLock().unlock();
            return false;
        } else {
            refreshPolicy.refreshOnReadIfRequired(refreshCallback);
            return true;
        }
    }
{code}

Its possible that any exception thrown in {{RefreshPolicy#refreshOnReadIfRequired}} can lead to lock being acquired but not released causing the lock to be lost and any further attempt to close such IndexNode instance would block indefinitely.

As a fix the {{acquire}} call should account for any potential exception thrown in any call made from within that method call



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)