Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-5262

StandardDirectoryReader should decRef readers on exception, not close them

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.5.1, 4.6, 6.0
    • Component/s: core/index
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      I've hit this while debugging a test, and was able to reproduce with a simple testcase. StandardDirectoryReader.open (nrt) calls IOUtils.close() on hitting an exception from RLD.getReadOnlyClone. But this is wrong, since if two attempts are made to obtain an NRT reader, and both of them fail, the readers that were closed on the first time are no longer closed, since their "closed" member is true. It should instead decRef() them. I'll upload a testcase and fix shortly.

        Attachments

          Activity

            People

            • Assignee:
              shaie Shai Erera
              Reporter:
              shaie Shai Erera
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: