manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1640752 - in /manifoldcf/branches/CONNECTORS-1100-1x: ./ framework/ framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
Date Thu, 20 Nov 2014 14:56:54 GMT
Author: kwright
Date: Thu Nov 20 14:56:54 2014
New Revision: 1640752

URL: http://svn.apache.org/r1640752
Log:
Pull up retry for deadlock for clearDocPriorities

Modified:
    manifoldcf/branches/CONNECTORS-1100-1x/   (props changed)
    manifoldcf/branches/CONNECTORS-1100-1x/framework/   (props changed)
    manifoldcf/branches/CONNECTORS-1100-1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java

Propchange: manifoldcf/branches/CONNECTORS-1100-1x/
------------------------------------------------------------------------------
  Merged /manifoldcf/trunk:r1640749,1640751

Propchange: manifoldcf/branches/CONNECTORS-1100-1x/framework/
------------------------------------------------------------------------------
  Merged /manifoldcf/trunk/framework:r1640749

Modified: manifoldcf/branches/CONNECTORS-1100-1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1100-1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java?rev=1640752&r1=1640751&r2=1640752&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1100-1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
(original)
+++ manifoldcf/branches/CONNECTORS-1100-1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
Thu Nov 20 14:56:54 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.
   *



Mime
View raw message