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

IndexWriter.addIndexes(IndexReader[] readers) doesn't correctly handle exception success flag.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4.1, 2.9
    • Component/s: None
    • Labels:
      None
    • Environment:

      Java

    • Lucene Fields:
      New

      Description

      After this bit of code in addIndexes(IndexReader[] readers)

      try

      { flush(true, false, true); optimize(); // start with zero or 1 seg success = true; }

      finally

      { // Take care to release the write lock if we hit an // exception before starting the transaction if (!success) releaseWrite(); }

      The success flag should be reset to "false" because it's used again in another try/catch/finally block.

      TestIndexWriter.testAddIndexOnDiskFull() sometimes will hit this bug; but it's infrequent.

        Activity

        Hide
        mikemccand Michael McCandless added a comment -

        Thanks! I'll fix on 2.4.1 as well, and re-spin the release candidate.

        Show
        mikemccand Michael McCandless added a comment - Thanks! I'll fix on 2.4.1 as well, and re-spin the release candidate.

          People

          • Assignee:
            mikemccand Michael McCandless
            Reporter:
            sgarland Scott Garland
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development