[ 
https://issues.apache.org/jira/browse/SOLR-12314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16466208#comment-16466208
 ] 

Varun Thacker commented on SOLR-12314:
--------------------------------------

CUSC is a SolrJ public API so as Mark pointed out we can simply omit the socket 
timeout's and connection timeout's that the user is specifying in the 
constructor.

In this approach when StreamingSolrClients creates a CUSC object to send data , 
we basically read the socket timeout's and connection timeout's from the 
UpdateShardHandler / UpdateShardHandlerConfig and set it explicitly. If the 
user has specifying none/only one of them then default values will be used for 
the timeout's that weren't specified. 

> ConcurrentUpdateSolrClient doesn't respect the timeout's defined in the 
> solr.xml file
> -------------------------------------------------------------------------------------
>
>                 Key: SOLR-12314
>                 URL: https://issues.apache.org/jira/browse/SOLR-12314
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Varun Thacker
>            Assignee: Varun Thacker
>            Priority: Major
>         Attachments: SOLR-12314.patch, SOLR-12314.patch
>
>
> 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. 
>  
> {code:java}
> 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());{code}
> While creating the httpclient object we ensure that the default request is 
> set with the properties we care about.  This happens in 
> HttpClientUtils#setupBuilder
> {code:java}
> RequestConfig requestConfig = requestConfigBuilder.build();
> HttpClientBuilder retBuilder = 
> builder.setDefaultRequestConfig(requestConfig);{code}
> 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



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to