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

Call processEvents before IndexWriter is closed

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.6
    • 4.6.1, 4.7, 6.0
    • core/index
    • None
    • New, Patch Available

    Description

      We saw failures on jenkins that complain about processing events in the IW while the IW is already closed:

      com.carrotsearch.randomizedtesting.UncaughtExceptionError: Captured an uncaught exception in thread: Thread[id=193, name=Thread-133, state=RUNNABLE, group=TGRP-TestIndexWriterWithThreads]
      Caused by: java.lang.RuntimeException: org.apache.lucene.store.AlreadyClosedException: this IndexWriter is closed
              at __randomizedtesting.SeedInfo.seed([3FAF37E1AFFB2502]:0)
              at org.apache.lucene.index.TestIndexWriterWithThreads$1.run(TestIndexWriterWithThreads.java:619)
      Caused by: org.apache.lucene.store.AlreadyClosedException: this IndexWriter is closed
              at org.apache.lucene.index.IndexWriter.ensureOpen(IndexWriter.java:645)
              at org.apache.lucene.index.IndexWriter.numDeletedDocs(IndexWriter.java:622)
              at org.apache.lucene.index.IndexWriter.segString(IndexWriter.java:4265)
              at org.apache.lucene.index.IndexWriter.publishFlushedSegment(IndexWriter.java:2324)
              at org.apache.lucene.index.DocumentsWriterFlushQueue$FlushTicket.publishFlushedSegment(DocumentsWriterFlushQueue.java:198)
              at org.apache.lucene.index.DocumentsWriterFlushQueue$FlushTicket.finishFlush(DocumentsWriterFlushQueue.java:213)
              at org.apache.lucene.index.DocumentsWriterFlushQueue$SegmentFlushTicket.publish(DocumentsWriterFlushQueue.java:249)
              at org.apache.lucene.index.DocumentsWriterFlushQueue.innerPurge(DocumentsWriterFlushQueue.java:116)
              at org.apache.lucene.index.DocumentsWriterFlushQueue.forcePurge(DocumentsWriterFlushQueue.java:138)
              at org.apache.lucene.index.DocumentsWriter.purgeBuffer(DocumentsWriter.java:185)
              at org.apache.lucene.index.IndexWriter.purge(IndexWriter.java:4634)
              at org.apache.lucene.index.DocumentsWriter$ForcedPurgeEvent.process(DocumentsWriter.java:701)
              at org.apache.lucene.index.IndexWriter.processEvents(IndexWriter.java:4665)
              at org.apache.lucene.index.IndexWriter.processEvents(IndexWriter.java:4657)
              at org.apache.lucene.index.IndexWriter.closeInternal(IndexWriter.java:1067)
              at org.apache.lucene.index.IndexWriter.rollbackInternal(IndexWriter.java:2106)
              at org.apache.lucene.index.IndexWriter.rollback(IndexWriter.java:2024)
              at org.apache.lucene.index.TestIndexWriterWithThreads$1.run(TestIndexWriterWithThreads.java:575)
      

      we need to process the events before we enter the finally block in IW#closeInternal

      Attachments

        1. LUCENE-5374.patch
          0.7 kB
          Simon Willnauer

        Activity

          People

            simonw Simon Willnauer
            simonw Simon Willnauer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: