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

IndexWriter should detect when it's used after being closed

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1
    • 2.2
    • core/index
    • None
    • 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.patch
          70 kB
          Michael McCandless
        2. LUCENE-818.take2.patch
          70 kB
          Michael McCandless
        3. LUCENE-818.take3.patch
          67 kB
          Michael McCandless
        4. LUCENE-818.take4.patch
          68 kB
          Michael McCandless
        5. LUCENE-818.take5.patch
          49 kB
          Michael McCandless

        Activity

          People

            mikemccand Michael McCandless
            mikemccand Michael McCandless
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: