SEARCH-2401: Add socketTimeOut parameter to HttpConnections

This commit is contained in:
Angel Borroy
2020-09-02 18:07:56 +02:00
parent f6a91ddf22
commit 65a0a6726a
2 changed files with 11 additions and 3 deletions

View File

@@ -3996,7 +3996,14 @@ public class SolrInformationServer implements InformationServer
} }
catch (Exception exception) catch (Exception exception)
{ {
LOGGER.error("Unable to get nodes metadata from repository. See the stacktrace below for further details.", exception); LOGGER.error("Unable to get nodes metadata from repository using "
+ "fromNodeId=" + parameters.getFromNodeId() + ", "
+ "toNodeId=" + parameters.getToNodeId() + ", "
+ "nodeIds=" + parameters.getNodeIds() + ", "
+ "fromTxId=" + parameters.getFromTxnId() + ", "
+ "toTxId=" + parameters.getToTxnId() + ", "
+ "txIds=" + parameters.getTransactionIds()
+ ". See the stacktrace below for further details.", exception);
return empty(); return empty();
} }
} }

View File

@@ -195,7 +195,7 @@ public class SOLRAPIClientFactory
else else
{ {
httpClientFactory = new PlainHttpClientFactory(alfrescoHost, alfrescoPort, maxTotalConnections, httpClientFactory = new PlainHttpClientFactory(alfrescoHost, alfrescoPort, maxTotalConnections,
maxHostConnections); maxHostConnections, socketTimeout);
} }
AlfrescoHttpClient repoClient = httpClientFactory.getRepoClient(alfrescoHost, alfrescoPortSSL); AlfrescoHttpClient repoClient = httpClientFactory.getRepoClient(alfrescoHost, alfrescoPortSSL);
@@ -235,13 +235,14 @@ public class SOLRAPIClientFactory
*/ */
class PlainHttpClientFactory extends HttpClientFactory class PlainHttpClientFactory extends HttpClientFactory
{ {
public PlainHttpClientFactory(String host, int port, int maxTotalConnections, int maxHostConnections) public PlainHttpClientFactory(String host, int port, int maxTotalConnections, int maxHostConnections, int socketTimeout)
{ {
setSecureCommsType("none"); setSecureCommsType("none");
setHost(host); setHost(host);
setPort(port); setPort(port);
setMaxTotalConnections(maxTotalConnections); setMaxTotalConnections(maxTotalConnections);
setMaxHostConnections(maxHostConnections); setMaxHostConnections(maxHostConnections);
setSocketTimeout(socketTimeout);
init(); init();
} }