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

OpenNLPOpsFactory leaks filehandles of models

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.3, 8.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      I appears that all methods in OpenNLPOpsFactory which use a ResourceLoader to get an InputStream to use for building a model are not closing those InputStreams

      This doesn't seem to negatively affect any existing lucene/analysis/opennlp tests, because the JVM doesn't know/care that there is a filehandle still open at the end of the test (is there a way to make the test complain?) but it does seem to cause a Solr level test failure on windows (SOLR-12046) because the solr tests create a temp dir where pre-built models are copied for use, and when the test completes the cleanup attempts to delete those copies of the files but windows won't let it because they are still open.

      presumably if a lucene/analysis/opennlp test also made a copy of the files a similar failure would be triggered – but only on windows

        Attachments

        1. LUCENE-8188.patch
          5 kB
          Chris M. Hostetter

          Issue Links

            Activity

              People

              • Assignee:
                hossman Chris M. Hostetter
                Reporter:
                hossman Chris M. Hostetter
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: