manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1477011 - /manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
Date Mon, 29 Apr 2013 12:44:59 GMT
Author: kwright
Date: Mon Apr 29 12:44:58 2013
New Revision: 1477011

URL: http://svn.apache.org/r1477011
Log:
Enhance solr error log output; part of CONNECTORS-682.

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

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=1477011&r1=1477010&r2=1477011&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 Apr 29 12:44:58 2013
@@ -397,7 +397,11 @@ public class HttpPoster
     if (code == 500)
     {
       long currentTime = System.currentTimeMillis();
-      throw new ServiceInterruption("Solr exception during "+context+" ("+e.code()+"): "+e.getMessage(),
+      
+      // Log the error
+      String message = "Solr exception during "+context+" ("+e.code()+"): "+e.getMessage();
+      Logging.ingest.warn(message,e);
+      throw new ServiceInterruption(message,
         e,
         currentTime + interruptionRetryTime,
         currentTime + 2L * 60L * 60000L,
@@ -434,20 +438,26 @@ public class HttpPoster
       if (e.getMessage().toLowerCase(Locale.ROOT).indexOf("broken pipe") != -1 ||
         e.getMessage().toLowerCase(Locale.ROOT).indexOf("connection reset") != -1 ||
         e.getMessage().toLowerCase(Locale.ROOT).indexOf("target server failed to respond")
!= -1)
+      {
         // Treat it as a service interruption, but with a limited number of retries.
         // In that way we won't burden the user with a huge retry interval; it should
         // give up fairly quickly, and yet NOT give up if the error was merely transient
-        throw new ServiceInterruption("Server dropped connection during "+context+": "+e.getMessage(),
+        String message = "Server dropped connection during "+context+": "+e.getMessage();
+        Logging.ingest.warn(message,e);
+        throw new ServiceInterruption(message,
           e,
           currentTime + interruptionRetryTime,
           -1L,
           3,
           false);
+      }
       
       // Other socket exceptions are service interruptions - but if we keep getting them,
it means 
       // that a socket timeout is probably set too low to accept this particular document.
 So
       // we retry for a while, then skip the document.
-      throw new ServiceInterruption("Socket timeout exception during "+context+": "+e.getMessage(),
+      String message2 = "Socket timeout exception during "+context+": "+e.getMessage();
+      Logging.ingest.warn(message2,e);
+      throw new ServiceInterruption(message2,
         e,
         currentTime + interruptionRetryTime,
         currentTime + 20L * 60000L,
@@ -456,7 +466,9 @@ public class HttpPoster
     }
     
     // Otherwise, no idea what the trouble is, so presume that retries might fix it.
-    throw new ServiceInterruption("IO exception during "+context+": "+e.getMessage(),
+    String message3 = "IO exception during "+context+": "+e.getMessage();
+    Logging.ingest.warn(message3,e);
+    throw new ServiceInterruption(message3,
       e,
       currentTime + interruptionRetryTime,
       currentTime + 2L * 60L * 60000L,



Mime
View raw message