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

IndexWriter should detect when it's used after being closed

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.2
    • Component/s: core/index
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Spinoff from this thread on java-user:

      http://www.gossamer-threads.com/lists/lucene/java-user/45986

      If you call addDocument on IndexWriter after it's closed you'll hit a
      hard-to-explain NullPointerException (because the RAMDirectory was
      closed). Before 2.1, apparently you won't hit any exception and the
      IndexWrite will keep running but will have released it's write lock (I
      think).

      I plan to fix IndexWriter methods to throw an IllegalStateException if
      it has been closed.

        Attachments

        1. LUCENE-818.take5.patch
          49 kB
          Michael McCandless
        2. LUCENE-818.take4.patch
          68 kB
          Michael McCandless
        3. LUCENE-818.take3.patch
          67 kB
          Michael McCandless
        4. LUCENE-818.take2.patch
          70 kB
          Michael McCandless
        5. LUCENE-818.patch
          70 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: