You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2013/02/12 21:27:10 UTC
svn commit: r1445340 - in /manifoldcf/trunk: CHANGES.txt
framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/ServiceInterruption.java
framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/WorkerThread.java
Author: kwright
Date: Tue Feb 12 20:27:10 2013
New Revision: 1445340
URL: http://svn.apache.org/r1445340
Log:
Fix for CONNECTORS-644.
Modified:
manifoldcf/trunk/CHANGES.txt
manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/ServiceInterruption.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/WorkerThread.java
Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1445340&r1=1445339&r2=1445340&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Tue Feb 12 20:27:10 2013
@@ -3,6 +3,9 @@ $Id$
======================= 1.2-dev =====================
+CONNECTORS-644: Restart button did not work.
+(Erlend Garåsen, Karl Wright)
+
CONNECTORS-643: Fix spurious error report for Elastic Search deletions
in Simple History.
(Karl Wright)
Modified: manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/ServiceInterruption.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/ServiceInterruption.java?rev=1445340&r1=1445339&r2=1445340&view=diff
==============================================================================
--- manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/ServiceInterruption.java (original)
+++ manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/ServiceInterruption.java Tue Feb 12 20:27:10 2013
@@ -35,18 +35,31 @@ public class ServiceInterruption extends
protected int failRetryCount;
/** Should we abort the process if failure condition has been reached? */
protected boolean abortOnFail;
-
+ /** True if job inactive abort. */
+ protected boolean jobInactiveAbort;
+
/** Constructor.
*@param message is the exact error condition.
*@param retryTime is the time to retry.
*/
public ServiceInterruption(String message, long retryTime)
{
+ this(message, retryTime, false);
+ }
+
+ /** Constructor.
+ *@param message is the exact error condition.
+ *@param retryTime is the time to retry.
+ *@param jobInactiveAbort is true if this exception being thrown because the job is aborting
+ */
+ public ServiceInterruption(String message, long retryTime, boolean jobInactiveAbort)
+ {
super(message);
this.retryTime = retryTime;
this.failTime = -1L;
this.failRetryCount = -1;
this.abortOnFail = true;
+ this.jobInactiveAbort = jobInactiveAbort;
}
/** Constructor.
@@ -100,4 +113,12 @@ public class ServiceInterruption extends
return abortOnFail;
}
+ /** Check if this service interruption is due to a job aborting.
+ *@return true if yes
+ */
+ public boolean jobInactiveAbort()
+ {
+ return jobInactiveAbort;
+ }
+
}
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/WorkerThread.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/WorkerThread.java?rev=1445340&r1=1445339&r2=1445340&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/WorkerThread.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/WorkerThread.java Tue Feb 12 20:27:10 2013
@@ -332,11 +332,14 @@ public class WorkerThread extends Thread
// know that no documents were ingested.
// Therefore, active -> pending and activepurgatory -> pendingpurgatory
- Logging.jobs.warn("Pre-ingest service interruption reported for job "+
- job.getID()+" connection '"+job.getConnectionName()+"': "+
- e.getMessage());
+ if (!e.jobInactiveAbort())
+ {
+ Logging.jobs.warn("Pre-ingest service interruption reported for job "+
+ job.getID()+" connection '"+job.getConnectionName()+"': "+
+ e.getMessage());
+ }
- if (e.isAbortOnFail())
+ if (!e.jobInactiveAbort() && e.isAbortOnFail())
abortOnFail = new ManifoldCFException("Repeated service interruptions - failure getting document version"+((e.getCause()!=null)?": "+e.getCause().getMessage():""),e.getCause());
// Mark the current documents to be recrawled at the
@@ -1341,7 +1344,7 @@ public class WorkerThread extends Thread
throws ManifoldCFException, ServiceInterruption
{
if (jobManager.checkJobActive(job.getID()) == false)
- throw new ServiceInterruption("Job no longer active",System.currentTimeMillis());
+ throw new ServiceInterruption("Job no longer active",System.currentTimeMillis(),true);
}
/** Begin an event sequence.