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

IndexWriter.rollback can hang if a previous call hit an exception

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3, 2.3.1
    • Fix Version/s: 2.4
    • Component/s: core/index
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      IW.rollback has logic to make sure only one thread actually gets to do
      the rollback whenever multiple threads are calling it at the same
      time, by setting the "boolean closing" to true in the thread that got
      there first.

      Other threads wait for that variable to become false again before
      returning from abort.

      But, we are not restoring closing to false in a try/finally in
      rollback(), which means on hitting an exception in rollback, a
      subsequent call to rollback() will hang forever.

      close() has the same logic, but there is already a try/finally there
      to restore closing to false on exception.

      The fix is straightforward.

        Attachments

        1. LUCENE-1347.patch
          7 kB
          Michael McCandless
        2. LUCENE-1347.patch
          6 kB
          Michael McCandless

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: