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

SolrJ code review indicates potential for leaked HttpClient connections

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.5.1, 4.6, 6.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();
      

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              markrmiller@gmail.com Mark Miller
              Reporter:
              kwright@metacarta.com Karl Wright

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment