Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-16983

ObjectReleaseTracker completely useless in all SolrTestCaseJ4 based tests - masking unclosed InputStream in some SolrStream usecases

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • main (10.0), 9.4
    • None
    • None

    Description

      NOTE: This was masking a real bug in SolrStream

      Fixing tests that fialed while working on this bug lead me to discover that some usages of SolrStream weren't closing their TupleStreamParser which could result in unclosed InputStream (returned from the underlying HTTP client)
       

      SolrTestCase has a @ClassRule named solrClassRules which calls ObjectReleaseTracker.clearObjectTrackerAndCheckEmpty() in it's afterIfSuccessful() method to ensure that any objects which use ObjectReleaseTracker are correctly released (ie: closed)

      ...BUT...

      SolrTestCaseJ4 has an @AfterClass method named teardownTestCases() which calls ObjectReleaseTracker.clear() before the afterIfSuccessful() method of it's parent class's solrClassRules gets to run.

      ... Which means that ObjectReleaseTracker is completley useless in every test that descends from SolrTestCaseJ4.

       

      Attachments

        1. test-output-if-clear-is-removed-from-SolrTestCaseJ4.txt.gz
          785 kB
          Chris M. Hostetter
        2. SOLR-16983-2.patch
          19 kB
          Chris M. Hostetter
        3. SOLR-16983-1.patch
          13 kB
          Chris M. Hostetter
        4. SOLR-16983.patch
          5 kB
          Chris M. Hostetter
        5. SOLR-16983.bug-demo.nocommit.patch
          3 kB
          Chris M. Hostetter

        Issue Links

          Activity

            People

              hossman Chris M. Hostetter
              hossman Chris M. Hostetter
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: