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

IndexWriter.getReader() allocates file handles

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.9.2, 3.0.1, 4.0-ALPHA
    • core/index
    • None
    • Ubuntu 9.10, Java 6

    • New

    Description

      I am not sure if this is a "bug" or really just me not reading the Javadocs right...

      The IR returned by IW.getReader() leaks file handles if you do not close() it, leading to starvation of the available file handles/process. If it was clear from the docs that this was a new reader and not some reference owned by the writer then this would probably be ok. But as I read the docs the reader is internally managed by the IW, which at first shot lead me to believe that I shouldn't close it.

      So perhaps the docs should be amended to clearly state that this is a caller-owns reader that must be closed? Attaching a simple app that illustrates the problem.

      Attachments

        1. LuceneManyCommits.java
          3 kB
          Mikkel Kamstrup Erlandsen

        Activity

          People

            Unassigned Unassigned
            kamstrup Mikkel Kamstrup Erlandsen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: