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

SolrJ code review indicates potential for leaked HttpClient connections

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.0
    • 4.5.1, 4.6, 6.0
    • None
    • None

    Description

      The SolrJ HttpSolrServer implementation does not seem to handle errors properly and seems capable of leaking HttpClient connections. See the request() method in org.apache.solr.client.solrj.impl.HttpSolrServer. The issue is that exceptions thrown from within this method do not necessarily consume the stream when an exception is thrown. There is a try/finally block which reads (in part):

          } finally {
            if (respBody != null && processor!=null) {
              try {
                respBody.close();
              } catch (Throwable t) {} // ignore
            }
          }
      

      But, in order to always guarantee consumption of the stream, it should include:

      method.abort();
      

      Attachments

        1. SOLR-4327.patch
          1.0 kB
          Mark Miller
        2. SOLR-4327.patch
          1 kB
          Mark Miller

        Issue Links

          Activity

            People

              markrmiller@gmail.com Mark Miller
              kwright@metacarta.com Karl Wright
              Votes:
              3 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: