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

SolrClient leaks connections on compressed responses if the response is malformed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 7.7.2
    • 8.10
    • SolrJ
    • None

    Description

      Summary

      When the SolrJ receives a malformed response Entity, for example like the one described in SOLR-14456, the client leaks the connection forever as it's never released back to the pool.

      Problem description

      HttpSolrClient should have compression enabled, so it uses the compression interceptors.

      When the request is marked with "Content-Encoding: gzip" but for whatever reason the response is not in GZIP format, when  HttpSolrClient tries to close the connection using Utils.consumeFully(), it tries to create the GzipInputStream failing and throwing an Exception. The exception thrown makes it impossible to access the underlying InputStream to be closed, therefore the connection is leaked.

      Despite that the content in the response should honour the headers specified for it, SolrJ should be reliable enough to prevent the connection leak when this scenario happens. On top of the bug itself, not being able to set a timeout while waiting for a connection to be available, makes any application unresponsive as it will run out of threads eventually.

      Attachments

        1. multiple-wrapped-entities.png
          274 kB
          Roger Lehmann
        2. content-gzipped.png
          251 kB
          Roger Lehmann

        Issue Links

          Activity

            People

              houston Houston Putman
              samuelgmartinez Samuel García Martínez
              Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 50m
                  1h 50m