Author: kwright
Date: Wed Sep 21 09:38:31 2022
New Revision: 1904186

URL: http://svn.apache.org/viewvc?rev=1904186&view=rev
Log:
Complete CONNECTORS-1731

Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/build.xml
    
manifoldcf/trunk/connectors/generic/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/generic/GenericConnector.java
    manifoldcf/trunk/connectors/solr/build.xml

Modified: manifoldcf/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1904186&r1=1904185&r2=1904186&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Wed Sep 21 09:38:31 2022
@@ -3,6 +3,9 @@ $Id$
 
 ======================= 2.24-dev =====================
 
+CONNECTORS-1731: Better handling for ServiceInterruption exceptions.
+(Nguyen Huu)
+
 CONNECTORS-1726: Mismatch between form parameters in generic connector.
 (Nguyen Huu)
 

Modified: manifoldcf/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/build.xml?rev=1904186&r1=1904185&r2=1904186&view=diff
==============================================================================
--- manifoldcf/trunk/build.xml (original)
+++ manifoldcf/trunk/build.xml Wed Sep 21 09:38:31 2022
@@ -2353,6 +2353,11 @@ Use Apache Forrest version forrest-0.9-d
         <copy todir="lib/solr-8.x">
             <fileset 
dir="build/download/apache-manifoldcf-solr-8.x-plugin-bin/apache-manifoldcf-solr-8.x-plugin-2.2"/>
         </copy>
+        <get 
src="https://www.apache.org/dist/manifoldcf/apache-manifoldcf-solr-9.x-plugin-2.2/apache-manifoldcf-solr-9.x-plugin-2.2-bin.zip";
 dest="build/download/apache-manifoldcf-solr-9.x-plugin-bin.zip"/>
+        <unzip src="build/download/apache-manifoldcf-solr-9.x-plugin-bin.zip" 
dest="build/download/apache-manifoldcf-solr-9.x-plugin-bin"/>
+        <copy todir="lib/solr-9.x">
+            <fileset 
dir="build/download/apache-manifoldcf-solr-9.x-plugin-bin/apache-manifoldcf-solr-9.x-plugin-2.2"/>
+        </copy>
     </target>
 
 

Modified: 
manifoldcf/trunk/connectors/generic/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/generic/GenericConnector.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/generic/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/generic/GenericConnector.java?rev=1904186&r1=1904185&r2=1904186&view=diff
==============================================================================
--- 
manifoldcf/trunk/connectors/generic/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/generic/GenericConnector.java
 (original)
+++ 
manifoldcf/trunk/connectors/generic/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/generic/GenericConnector.java
 Wed Sep 21 09:38:31 2022
@@ -253,6 +253,8 @@ public class GenericConnector extends Ba
       t.interrupt();
       throw new ManifoldCFException("Interrupted: " + e.getMessage(), e,
         ManifoldCFException.INTERRUPTED);
+    } catch (ManifoldCFException e) {
+        handleManifoldCFException(e);
     }
     return new Long(seedTime).toString();
   }
@@ -301,6 +303,8 @@ public class GenericConnector extends Ba
         versions = versioningThread.finishUp();
       } catch (IOException ex) {
         handleIOException((IOException)ex);
+      } catch (ManifoldCFException ex) {
+        handleManifoldCFException(ex);
       } catch (InterruptedException ex) {
         throw new ManifoldCFException(ex.getMessage(), ex, 
ManifoldCFException.INTERRUPTED);
       }
@@ -442,6 +446,8 @@ public class GenericConnector extends Ba
               throw new ManifoldCFException("Interrupted: " + e.getMessage(), 
e, ManifoldCFException.INTERRUPTED);
             } catch (IOException e) {
               handleIOException(e);
+            } catch (ManifoldCFException e) {
+              handleManifoldCFException(e);
             }
           }
         }
@@ -1024,6 +1030,20 @@ public class GenericConnector extends Ba
       currentTime + 3 * 60 * 60000L, -1, false);
   }
 
+  /**
+   * Function for handling ManifoldCFException exception caused by connection 
error.
+   * In case of connection error, ServiceInterruption exception is thrown to 
perform retry.
+   * 
+   * @param e ManifoldCFException
+   * @throws ServiceInterruption
+   */
+  protected static void handleManifoldCFException(ManifoldCFException e)
+    throws ServiceInterruption {
+    long currentTime = System.currentTimeMillis();
+    throw new ServiceInterruption("Connection error: " + e.getMessage(), e, 
currentTime + 300000L,
+      currentTime + 3 * 60 * 60000L, -1, false);
+  }
+
   static class PreemptiveAuth implements HttpRequestInterceptor {
 
     private Credentials credentials;

Modified: manifoldcf/trunk/connectors/solr/build.xml
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/solr/build.xml?rev=1904186&r1=1904185&r2=1904186&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/solr/build.xml (original)
+++ manifoldcf/trunk/connectors/solr/build.xml Wed Sep 21 09:38:31 2022
@@ -83,6 +83,10 @@
         <copy todir="dist/integration/solr-8.x">
           <fileset dir="../../lib/solr-8.x"/>
         </copy>
+        <mkdir dir="dist/integration/solr-9.x"/>
+        <copy todir="dist/integration/solr-9.x">
+          <fileset dir="../../lib/solr-9.x"/>
+        </copy>
     </target>
 
     <target name="deliver-connector" 
depends="mcf-connector-build.deliver-connector">


Reply via email to