From add510e6a9c027f7b435228ad9a5d47bc743724e Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Sun, 17 Nov 2013 00:38:59 +0000 Subject: [PATCH] SOLR-5453: Raise recovery socket read timeouts. git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1542620 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 2 ++ .../java/org/apache/solr/cloud/RecoveryStrategy.java | 4 +--- .../src/java/org/apache/solr/cloud/SyncStrategy.java | 7 +++---- .../core/src/java/org/apache/solr/update/PeerSync.java | 10 +++------- .../org/apache/solr/update/StreamingSolrServers.java | 1 + .../src/test/org/apache/solr/cloud/SyncSliceTest.java | 2 +- 6 files changed, 11 insertions(+), 15 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index b2bb52a48a0..d63ea8bb02c 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -104,6 +104,8 @@ Bug Fixes * SOLR-5451: SyncStrategy closes it's http connection manager before the executor that uses it in it's close method. (Mark Miller) +* SOLR-5453: Raise recovery socket read timeouts. (Mark Miller) + Other Changes --------------------- diff --git a/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java b/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java index 6ad73c8ba62..596027b0f04 100644 --- a/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java +++ b/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java @@ -186,7 +186,6 @@ public class RecoveryStrategy extends Thread implements ClosableThread { HttpSolrServer server = new HttpSolrServer(leaderUrl); try { server.setConnectionTimeout(30000); - server.setSoTimeout(60000); UpdateRequest ureq = new UpdateRequest(); ureq.setParams(new ModifiableSolrParams()); ureq.getParams().set(DistributedUpdateProcessor.COMMIT_END_POINT, true); @@ -202,8 +201,7 @@ public class RecoveryStrategy extends Thread implements ClosableThread { throws SolrServerException, IOException { HttpSolrServer server = new HttpSolrServer(leaderBaseUrl); try { - server.setConnectionTimeout(45000); - server.setSoTimeout(120000); + server.setConnectionTimeout(30000); WaitForState prepCmd = new WaitForState(); prepCmd.setCoreName(leaderCoreName); prepCmd.setNodeName(zkController.getNodeName()); diff --git a/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java b/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java index 7ab219ec38a..274528552e7 100644 --- a/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java +++ b/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java @@ -67,8 +67,7 @@ public class SyncStrategy { ModifiableSolrParams params = new ModifiableSolrParams(); params.set(HttpClientUtil.PROP_MAX_CONNECTIONS, 10000); params.set(HttpClientUtil.PROP_MAX_CONNECTIONS_PER_HOST, 20); - params.set(HttpClientUtil.PROP_CONNECTION_TIMEOUT, 15000); - params.set(HttpClientUtil.PROP_SO_TIMEOUT, 60000); + params.set(HttpClientUtil.PROP_CONNECTION_TIMEOUT, 30000); params.set(HttpClientUtil.PROP_USE_RETRY, false); client = HttpClientUtil.createClient(params); } @@ -284,8 +283,8 @@ public class SyncStrategy { HttpSolrServer server = new HttpSolrServer(baseUrl, client); try { - server.setConnectionTimeout(15000); - server.setSoTimeout(60000); + server.setConnectionTimeout(30000); + server.setSoTimeout(120000); server.request(recoverRequestCmd); } catch (Throwable t) { SolrException.log(log, ZkCoreNodeProps.getCoreUrl(leaderProps) + ": Could not tell a replica to recover", t); diff --git a/solr/core/src/java/org/apache/solr/update/PeerSync.java b/solr/core/src/java/org/apache/solr/update/PeerSync.java index fe57116bbc1..e4507d5aebe 100644 --- a/solr/core/src/java/org/apache/solr/update/PeerSync.java +++ b/solr/core/src/java/org/apache/solr/update/PeerSync.java @@ -17,6 +17,9 @@ package org.apache.solr.update; +import static org.apache.solr.update.processor.DistributedUpdateProcessor.DistribPhase.FROMLEADER; +import static org.apache.solr.update.processor.DistributingUpdateProcessorFactory.DISTRIB_UPDATE_PARAM; + import java.io.IOException; import java.net.ConnectException; import java.net.SocketException; @@ -37,7 +40,6 @@ import org.apache.solr.cloud.ZkController; import org.apache.solr.common.SolrException; import org.apache.solr.common.SolrInputDocument; import org.apache.solr.common.params.ModifiableSolrParams; -import org.apache.solr.common.util.NamedList; import org.apache.solr.common.util.StrUtils; import org.apache.solr.core.SolrCore; import org.apache.solr.handler.component.HttpShardHandlerFactory; @@ -48,16 +50,11 @@ import org.apache.solr.handler.component.ShardResponse; import org.apache.solr.request.LocalSolrQueryRequest; import org.apache.solr.request.SolrQueryRequest; import org.apache.solr.response.SolrQueryResponse; -import org.apache.solr.update.processor.DistributedUpdateProcessorFactory; -import org.apache.solr.update.processor.RunUpdateProcessorFactory; import org.apache.solr.update.processor.UpdateRequestProcessor; import org.apache.solr.update.processor.UpdateRequestProcessorChain; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static org.apache.solr.update.processor.DistributingUpdateProcessorFactory.DISTRIB_UPDATE_PARAM; -import static org.apache.solr.update.processor.DistributedUpdateProcessor.DistribPhase.FROMLEADER; - /** @lucene.experimental */ public class PeerSync { public static Logger log = LoggerFactory.getLogger(PeerSync.class); @@ -88,7 +85,6 @@ public class PeerSync { params.set(HttpClientUtil.PROP_MAX_CONNECTIONS_PER_HOST, 20); params.set(HttpClientUtil.PROP_MAX_CONNECTIONS, 10000); params.set(HttpClientUtil.PROP_CONNECTION_TIMEOUT, 30000); - params.set(HttpClientUtil.PROP_SO_TIMEOUT, 30000); params.set(HttpClientUtil.PROP_USE_RETRY, false); client = HttpClientUtil.createClient(params); } diff --git a/solr/core/src/java/org/apache/solr/update/StreamingSolrServers.java b/solr/core/src/java/org/apache/solr/update/StreamingSolrServers.java index 02ec08939e6..3af7c328b8a 100644 --- a/solr/core/src/java/org/apache/solr/update/StreamingSolrServers.java +++ b/solr/core/src/java/org/apache/solr/update/StreamingSolrServers.java @@ -45,6 +45,7 @@ public class StreamingSolrServers { params.set(HttpClientUtil.PROP_MAX_CONNECTIONS, 128); params.set(HttpClientUtil.PROP_MAX_CONNECTIONS_PER_HOST, 32); params.set(HttpClientUtil.PROP_FOLLOW_REDIRECTS, false); + params.set(HttpClientUtil.PROP_CONNECTION_TIMEOUT, 30000); httpClient = HttpClientUtil.createClient(params); } diff --git a/solr/core/src/test/org/apache/solr/cloud/SyncSliceTest.java b/solr/core/src/test/org/apache/solr/cloud/SyncSliceTest.java index ad49dc1ba99..65ad0e8b851 100644 --- a/solr/core/src/test/org/apache/solr/cloud/SyncSliceTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/SyncSliceTest.java @@ -134,8 +134,8 @@ public class SyncSliceTest extends AbstractFullDistribZkTestBase { baseUrl = baseUrl.substring(0, baseUrl.length() - "collection1".length()); HttpSolrServer baseServer = new HttpSolrServer(baseUrl); + // we only set the connect timeout, not so timeout baseServer.setConnectionTimeout(15000); - baseServer.setSoTimeout(60000); baseServer.request(request); waitForThingsToLevelOut(15);