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 2014/11/20 15:55:06 UTC
svn commit: r1640751 - in /manifoldcf/branches/dev_1x: ./ framework/
framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
Author: kwright
Date: Thu Nov 20 14:55:05 2014
New Revision: 1640751
URL: http://svn.apache.org/r1640751
Log:
Pull up r1640749 from trunk. Part of CONNECTORS-1100.
Modified:
manifoldcf/branches/dev_1x/ (props changed)
manifoldcf/branches/dev_1x/framework/ (props changed)
manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
Propchange: manifoldcf/branches/dev_1x/
------------------------------------------------------------------------------
Merged /manifoldcf/trunk:r1640749
Propchange: manifoldcf/branches/dev_1x/framework/
------------------------------------------------------------------------------
Merged /manifoldcf/trunk/framework:r1640749
Modified: manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java?rev=1640751&r1=1640750&r2=1640751&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java (original)
+++ manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java Thu Nov 20 14:55:05 2014
@@ -8278,7 +8278,7 @@ public class JobManager implements IJobM
// See CONNECTORS-290.
// We do this BEFORE updating the job state.
- jobQueue.clearDocPriorities(jobID);
+ clearDocPriorities(jobID);
IJobDescription jobDesc = jobs.load(jobID,true);
modifiedJobs.add(jobDesc);
@@ -8297,6 +8297,51 @@ public class JobManager implements IJobM
}
}
+ protected void clearDocPriorities(Long jobID)
+ throws ManifoldCFException
+ {
+ while (true)
+ {
+ long sleepAmt = 0L;
+ database.beginTransaction();
+ try
+ {
+ jobQueue.clearDocPriorities(jobID);
+ database.performCommit();
+ break;
+ }
+ catch (ManifoldCFException e)
+ {
+ database.signalRollback();
+ if (e.getErrorCode() == e.DATABASE_TRANSACTION_ABORT)
+ {
+ if (Logging.perf.isDebugEnabled())
+ Logging.perf.debug("Aborted transaction clearing document priorities: "+e.getMessage());
+ sleepAmt = getRandomAmount();
+ continue;
+ }
+ throw e;
+ }
+ catch (RuntimeException e)
+ {
+ database.signalRollback();
+ TrackerClass.noteRollback();
+ throw e;
+ }
+ catch (Error e)
+ {
+ database.signalRollback();
+ TrackerClass.noteRollback();
+ throw e;
+ }
+ finally
+ {
+ database.endTransaction();
+ sleepFor(sleepAmt);
+ }
+ }
+ }
+
/** Reset eligible jobs either back to the "inactive" state, or make them active again. The
* latter will occur if the cleanup phase of the job generated more pending documents.
*