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

ConcurrentUpdateSolrClient doesn't respect the timeout's defined in the solr.xml file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 7.4, 8.0
    • None
    • None

    Description

      In ConcurrentUpdateSolrClient we create an HttpPost Request which allows you to set a request config. If the request config is not provided httpclient will use the default request config. 

       

      org.apache.http.client.config.RequestConfig.Builder requestConfigBuilder = HttpClientUtil.createDefaultRequestConfigBuilder();
      if (soTimeout != null) {
        requestConfigBuilder.setSocketTimeout(soTimeout);
      }
      if (connectionTimeout != null) {
        requestConfigBuilder.setConnectTimeout(connectionTimeout);
      }
      
      method.setConfig(requestConfigBuilder.build());

      While creating the httpclient object we ensure that the default request is set with the properties we care about.  This happens in HttpClientUtils#setupBuilder

      RequestConfig requestConfig = requestConfigBuilder.build();
      
      HttpClientBuilder retBuilder = builder.setDefaultRequestConfig(requestConfig);

      So there is no need to set a per request config 

       

      Here is where the httpclient picks the request config is provided on the request itself : https://github.com/apache/httpcomponents-client/blob/4.5.3/httpclient/src/main/java/org/apache/http/impl/client/InternalHttpClient.java#L168

       

      And if it's not provided it uses the default here : https://github.com/apache/httpcomponents-client/blob/4.5.3/httpclient/src/main/java/org/apache/http/impl/client/InternalHttpClient.java#L148

      Attachments

        1. SOLR-12314.patch
          5 kB
          Varun Thacker
        2. SOLR-12314.patch
          3 kB
          Varun Thacker
        3. SOLR-12314.patch
          1 kB
          Varun Thacker

        Issue Links

          Activity

            People

              varun Varun Thacker
              varun Varun Thacker
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: