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

close() throws incorrect IllegalStateEx after IndexWriter hit an OOME when autoCommit is true

    Details

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

      Description

      Spinoff from http://www.nabble.com/IllegalStateEx-thrown-when-calling-close-to20201825.html

      When IndexWriter hits an OOME, it records this and then if close() is
      called it calls rollback() instead. This is a defensive measure, in
      case the OOME corrupted the internal buffered state (added/deleted
      docs).

      But there's a bug: if you opened IndexWriter with autoCommit true,
      close() then incorrectly throws an IllegalStatException.

      This fix is simple: allow rollback to be called even if autoCommit is
      true, internally during close. (External calls to rollback with
      autoCommmit true is still not allowed).

        Activity

        Hide
        mikemccand Michael McCandless added a comment -

        Thanks Jed!

        Show
        mikemccand Michael McCandless added a comment - Thanks Jed!
        Hide
        jedws Jed Wesley-Smith added a comment -

        Thanks Michael, I'll try and work out the best policy for the client code that should notice OOME and react appropriately.

        Show
        jedws Jed Wesley-Smith added a comment - Thanks Michael, I'll try and work out the best policy for the client code that should notice OOME and react appropriately.
        Hide
        mikemccand Michael McCandless added a comment -

        Reopening for backport to 2.4.1.

        Show
        mikemccand Michael McCandless added a comment - Reopening for backport to 2.4.1.
        Hide
        mikemccand Michael McCandless added a comment -

        Committed revision 745788 on 2.4 branch.

        Show
        mikemccand Michael McCandless added a comment - Committed revision 745788 on 2.4 branch.

          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:

              Development