Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-3869: A PeerSync attempt to it's replicas by a candidate leader should not fail on o.a.http.conn.ConnectTimeoutException. Also turn on the use of jetty test mode with sys prop that was no longer being used - this improves the situation when we restart jetty. Both of these fixes should help our FreeBSD continuous build.

Mark Robert Millerc656ba11bf07
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 7d66f9fa909..834e24774c0 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -337,6 +337,9 @@ Bug Fixes
* SOLR-3783: Fixed Pivot Faceting to work with facet.missing=true (hossman)
+* SOLR-3869: A PeerSync attempt to it's replicas by a candidate leader should
+ not fail on o.a.http.conn.ConnectTimeoutException. (Mark Miller)
+
Other Changes
----------------------
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 4dd040fa575..a98917e53ad 100644
--- a/solr/core/src/java/org/apache/solr/update/PeerSync.java
+++ b/solr/core/src/java/org/apache/solr/update/PeerSync.java
@@ -28,6 +28,7 @@ import java.util.Set;
import org.apache.http.NoHttpResponseException;
import org.apache.http.client.HttpClient;
+import org.apache.http.conn.ConnectTimeoutException;
import org.apache.lucene.util.BytesRef;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.HttpClientUtil;
@@ -299,7 +300,7 @@ public class PeerSync {
if (cantReachIsSuccess && sreq.purpose == 1 && srsp.getException() instanceof SolrServerException) {
Throwable solrException = ((SolrServerException) srsp.getException())
.getRootCause();
- if (solrException instanceof ConnectException
+ if (solrException instanceof ConnectException || solrException instanceof ConnectTimeoutException
|| solrException instanceof NoHttpResponseException) {
log.warn(msg() + " couldn't connect to " + srsp.getShardAddress() + ", counting as success");
diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
index 6edf610fc06..efc80ba18d6 100755
--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
@@ -81,6 +81,7 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
@BeforeClass
@SuppressWarnings("unused")
private static void beforeClass() {
+ System.setProperty("jetty.testMode", "true");
setupLogging();
startTrackingSearchers();
startTrackingZkClients();
@@ -95,6 +96,7 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
endTrackingSearchers();
endTrackingZkClients();
resetFactory();
+ System.clearProperty("jetty.testMode");
}
private static boolean changedFactory = false;