Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-5649

Error in RefreshPolicy can lead to IndexNode lock leak

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.0
    • 1.7.0, 1.6.1, 1.8.0
    • lucene
    • None

    Description

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

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

      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

      Attachments

        1. OAK-5649-v1.patch
          2 kB
          Chetan Mehrotra

        Issue Links

          Activity

            People

              chetanm Chetan Mehrotra
              chetanm Chetan Mehrotra
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: