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

I/O exception in DocsWriter add or updateDocument may not delete unreferenced files

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.3
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      If an I/O exception is thrown in DocumentsWriter#addDocument or #updateDocument, the stored fields files may not be cleaned up.

        Activity

        Hide
        steven_parkes Steven Parkes added a comment -

        Patch adds wrappers in IndexWriter to catch exceptions thrown in docswriter and to call deleter.refresh before passing the exception back to the caller.

        Adds a test.

        I might have possibly not picked the best place to do that catch ...

        Show
        steven_parkes Steven Parkes added a comment - Patch adds wrappers in IndexWriter to catch exceptions thrown in docswriter and to call deleter.refresh before passing the exception back to the caller. Adds a test. I might have possibly not picked the best place to do that catch ...
        Hide
        mikemccand Michael McCandless added a comment -

        Good catch Steven!

        I think where you put the try/finally is good. The only tiny thing I
        noticed is in your unit test when you create the MockRAMDirectory you
        don't have to pass in an empty RAMDirectory; you can just use the
        no-argument constructor instead.

        I will commit this.

        Show
        mikemccand Michael McCandless added a comment - Good catch Steven! I think where you put the try/finally is good. The only tiny thing I noticed is in your unit test when you create the MockRAMDirectory you don't have to pass in an empty RAMDirectory; you can just use the no-argument constructor instead. I will commit this.

          People

          • Assignee:
            steven_parkes Steven Parkes
            Reporter:
            steven_parkes Steven Parkes
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development