manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1432958 - in /manifoldcf/trunk: CHANGES.txt connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
Date Mon, 14 Jan 2013 15:40:26 GMT
Author: kwright
Date: Mon Jan 14 15:40:26 2013
New Revision: 1432958

URL: http://svn.apache.org/viewvc?rev=1432958&view=rev
Log:
Fix for CONNECTORS-610.

Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1432958&r1=1432957&r2=1432958&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Mon Jan 14 15:40:26 2013
@@ -3,6 +3,10 @@ $Id$
 
 ======================= 1.1-dev =====================
 
+CONNECTORS-610: Can't use retries with httpclient instance used
+with solrj, so disable retries explicitly.
+(Ahmet Arslan, Karl Wright)
+
 CONNECTORS-609: Solrj doesn't always set the code property of
 its http exceptions right, so we need to parse it out ourselves.
 (Ahmet Arslan, Karl Wright)

Modified: manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java?rev=1432958&r1=1432957&r2=1432958&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
(original)
+++ manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
Mon Jan 14 15:40:26 2013
@@ -51,6 +51,8 @@ import org.apache.http.conn.scheme.Schem
 import org.apache.http.conn.ssl.SSLSocketFactory;
 import org.apache.http.conn.ssl.AllowAllHostnameVerifier;
 import org.apache.http.conn.params.ConnRoutePNames;
+import org.apache.http.client.HttpRequestRetryHandler;
+import org.apache.http.protocol.HttpContext;
 
 import org.apache.solr.client.solrj.SolrServer;
 import org.apache.solr.client.solrj.SolrServerException;
@@ -217,7 +219,20 @@ public class HttpPoster
     params.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT,connectionTimeout);
     params.setBooleanParameter(ClientPNames.HANDLE_REDIRECTS,true);
     DefaultHttpClient localClient = new DefaultHttpClient(connectionManager,params);
-          
+
+    // No retries
+    localClient.setHttpRequestRetryHandler(new HttpRequestRetryHandler()
+      {
+	public boolean retryRequest(
+	  IOException exception,
+	  int executionCount,
+	    HttpContext context)
+	{
+	  return false;
+	}
+     
+      });
+    
     if (userID != null && userID.length() > 0 && password != null)
     {
       Credentials credentials = new UsernamePasswordCredentials(userID, password);



Mime
View raw message