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

Ensure that IndexNodeManager releases lock in case of error in acquiring it

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.7.8, 1.6.6, 1.8.0
    • lucene
    • None

    Description

      Currently IndexNodeManager acquires the lock like below. Here if any exception occurs in IndexNodeImpl then lock would remain acquired

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

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: