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

IndexWriter leaks CFS handles in some exceptional cases

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.8.1
    • 4.8.1, 4.9, 6.0
    • None
    • None
    • New

    Description

      in trunk:

      ant test -Dtestcase=TestIndexWriterOutOfMemory -Dtests.method=testBasics -Dtests.seed=3D485DE153FCA22D -Dtests.nightly=true -Dtests.locale=no_NO -Dtests.timezone=CAT -Dtests.file.encoding=US-ASCII

      Seems to happen when an exception is thrown here:

         [junit4]   1> java.lang.OutOfMemoryError: Fake OutOfMemoryError
         [junit4]   1> 	at org.apache.lucene.index.TestIndexWriterOutOfMemory$2.eval(TestIndexWriterOutOfMemory.java:117)
         [junit4]   1> 	at org.apache.lucene.store.MockDirectoryWrapper.maybeThrowDeterministicException(MockDirectoryWrapper.java:888)
         [junit4]   1> 	at org.apache.lucene.store.MockDirectoryWrapper.openInput(MockDirectoryWrapper.java:575)
         [junit4]   1> 	at org.apache.lucene.store.Directory.openChecksumInput(Directory.java:107)
         [junit4]   1> 	at org.apache.lucene.codecs.lucene45.Lucene45DocValuesProducer.<init>(Lucene45DocValuesProducer.java:84)
         [junit4]   1> 	at org.apache.lucene.codecs.lucene45.Lucene45DocValuesFormat.fieldsProducer(Lucene45DocValuesFormat.java:178)
         [junit4]   1> 	at org.apache.lucene.codecs.perfield.PerFieldDocValuesFormat$FieldsReader.<init>(PerFieldDocValuesFormat.java:232)
         [junit4]   1> 	at org.apache.lucene.codecs.perfield.PerFieldDocValuesFormat.fieldsProducer(PerFieldDocValuesFormat.java:324)
         [junit4]   1> 	at org.apache.lucene.index.SegmentDocValues.newDocValuesProducer(SegmentDocValues.java:51)
         [junit4]   1> 	at org.apache.lucene.index.SegmentDocValues.getDocValuesProducer(SegmentDocValues.java:68)
         [junit4]   1> 	at org.apache.lucene.index.SegmentReader.initDocValuesProducers(SegmentReader.java:189)
         [junit4]   1> 	at org.apache.lucene.index.SegmentReader.<init>(SegmentReader.java:166)
         [junit4]   1> 	at org.apache.lucene.index.ReadersAndUpdates.writeFieldUpdates(ReadersAndUpdates.java:553)
         [junit4]   1> 	at org.apache.lucene.index.BufferedUpdatesStream.applyDeletesAndUpdates(BufferedUpdatesStream.java:230)
         [junit4]   1> 	at org.apache.lucene.index.IndexWriter.applyAllDeletesAndUpdates(IndexWriter.java:3086)
         [junit4]   1> 	at org.apache.lucene.index.IndexWriter.maybeApplyDeletes(IndexWriter.java:3077)
         [junit4]   1> 	at org.apache.lucene.index.IndexWriter.prepareCommitInternal(IndexWriter.java:2791)
         [junit4]   1> 	at org.apache.lucene.index.IndexWriter.commitInternal(IndexWriter.java:2940)
         [junit4]   1> 	at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:2907)
      

      and the leak is from here:

         [junit4]    > Caused by: java.lang.RuntimeException: unclosed IndexInput: _0_Asserting_0.dvd
         [junit4]    > 	at org.apache.lucene.store.MockDirectoryWrapper.addFileHandle(MockDirectoryWrapper.java:560)
         [junit4]    > 	at org.apache.lucene.store.MockDirectoryWrapper.openInput(MockDirectoryWrapper.java:604)
         [junit4]    > 	at org.apache.lucene.codecs.lucene45.Lucene45DocValuesProducer.<init>(Lucene45DocValuesProducer.java:116)
         [junit4]    > 	at org.apache.lucene.codecs.lucene45.Lucene45DocValuesFormat.fieldsProducer(Lucene45DocValuesFormat.java:178)
         [junit4]    > 	at org.apache.lucene.codecs.asserting.AssertingDocValuesFormat.fieldsProducer(AssertingDocValuesFormat.java:61)
         [junit4]    > 	at org.apache.lucene.codecs.perfield.PerFieldDocValuesFormat$FieldsReader.<init>(PerFieldDocValuesFormat.java:232)
         [junit4]    > 	at org.apache.lucene.codecs.perfield.PerFieldDocValuesFormat.fieldsProducer(PerFieldDocValuesFormat.java:324)
         [junit4]    > 	at org.apache.lucene.index.SegmentDocValues.newDocValuesProducer(SegmentDocValues.java:51)
         [junit4]    > 	at org.apache.lucene.index.SegmentDocValues.getDocValuesProducer(SegmentDocValues.java:68)
         [junit4]    > 	at org.apache.lucene.index.SegmentReader.initDocValuesProducers(SegmentReader.java:189)
         [junit4]    > 	at org.apache.lucene.index.SegmentReader.<init>(SegmentReader.java:116)
         [junit4]    > 	at org.apache.lucene.index.ReadersAndUpdates.getReader(ReadersAndUpdates.java:133)
         [junit4]    > 	at org.apache.lucene.index.BufferedUpdatesStream.applyDeletesAndUpdates(BufferedUpdatesStream.java:211)
         [junit4]    > 	at org.apache.lucene.index.IndexWriter.applyAllDeletesAndUpdates(IndexWriter.java:3086)
         [junit4]    > 	at org.apache.lucene.index.IndexWriter.maybeApplyDeletes(IndexWriter.java:3077)
         [junit4]    > 	at org.apache.lucene.index.IndexWriter.prepareCommitInternal(IndexWriter.java:2791)
         [junit4]    > 	at org.apache.lucene.index.IndexWriter.commitInternal(IndexWriter.java:2940)
         [junit4]    > 	at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:2907)
         [junit4]    > 	at org.apache.lucene.index.TestIndexWriterOutOfMemory.testBasics(TestIndexWriterOutOfMemory.java:209)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            rcmuir Robert Muir
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: