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

Constructor of IndexWriter let's runtime exceptions pop up, while keeping the writeLock obtained

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 3.0.1
    • 2.9.3, 3.0.2, 3.1, 4.0-ALPHA
    • core/store
    • None
    • New

    Description

      Constructor of IndexWriter let's runtime exceptions pop up, while keeping the writeLock obtained.

      The init method in IndexWriter catches IOException only (I got NegativeArraySize by reading up a corrupt index), and now, there is no way to recover, since the writeLock will be kept obtained. Moreover, I don't have IndexWriter instance either, to "grab" the lock somehow, since the init() method is called from IndexWriter constructor.

      Either broaden the catch to all exceptions, or at least provide some circumvention to clear up. In my case, I'd like to "fallback", just delete the corrupted index from disk and recreate it, but it is impossible, since the LOCK_HELD NativeFSLockFactory's entry about obtained WriteLock is never cleaned out and is no (at least apparent) way to clean it out forcibly. I can't create new IndexWriter, since it will always fail with LockObtainFailedException.

      Attachments

        1. LUCENE-2476.patch
          2 kB
          Michael McCandless

        Activity

          People

            mikemccand Michael McCandless
            cstamas Tamás Cservenák
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: