Solr
  1. Solr
  2. SOLR-4327

SolrJ code review indicates potential for leaked HttpClient connections

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.5.1, 4.6, 5.0
    • Component/s: None
    • Labels:
      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();
      
      1. SOLR-4327.patch
        1 kB
        Mark Miller
      2. SOLR-4327.patch
        1.0 kB
        Mark Miller

        Activity

          People

          • Assignee:
            Mark Miller
            Reporter:
            Karl Wright
          • Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development