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

StandardBenchmarker#makeDocument does not explicitly close opened files

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      Patch Available

      Description

      StandardBenchmarker#makeDocument(File in, String[] tags, boolean stored, boolean tokenized, boolean tfv)

      BufferedReader reader = new BufferedReader(new FileReader(in));

      Above reader is not closed until GC hits it. Can cause problems in cases where ulimit is set too low.

      I did this:

      while ((line = reader.readLine()) != null)

      { body.append(line).append(' '); }

      + reader.close();

        Attachments

        1. LUCENE-829.patch
          3 kB
          Doron Cohen

          Activity

            People

            • Assignee:
              doronc Doron Cohen
              Reporter:
              karl.wettin Karl Wettin
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: