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

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.8, 1.6.6, 1.8.0
    • Component/s: lucene
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: