stillalex commented on code in PR #1565:
URL: https://github.com/apache/solr/pull/1565#discussion_r1178026053


##########
solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java:
##########
@@ -168,6 +168,12 @@ protected HttpSolrClient(Builder builder) {
       this.internalClient = false;
       this.followRedirects = builder.followRedirects;
       this.httpClient = builder.httpClient;
+      // The getParams() is not supported by this httpClient type!  Throws 
exception.
+      // this.soTimeout = 
builder.httpClient..getIntParameter(HttpClientUtil.PROP_SO_TIMEOUT,
+      // Math.toIntExact(builder.socketTimeoutMillis));
+      // this.connectionTimeout =
+      // 
builder.httpClient.getParams().getIntParameter(HttpClientUtil.PROP_CONNECTION_TIMEOUT,
+      // Math.toIntExact(builder.connectionTimeoutMillis));

Review Comment:
   this can be 
   ```
         if(this.httpClient instanceof Configurable) {
           RequestConfig conf = ((Configurable) httpClient).getConfig();
           this.connectionTimeout = conf.getConnectTimeout();
           this.soTimeout = conf.getSocketTimeout();
         }
   ```
   
   but also need to move the below from line 193 to the else branch on this if 
(line 185) so these 2 values only get set once
   ```
      this.connectionTimeout = Math.toIntExact(builder.connectionTimeoutMillis);
       this.soTimeout = Math.toIntExact(builder.socketTimeoutMillis);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to