manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1636334 - in /manifoldcf/trunk: CHANGES.txt framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
Date Mon, 03 Nov 2014 12:23:55 GMT
Author: kwright
Date: Mon Nov  3 12:23:55 2014
New Revision: 1636334

URL: http://svn.apache.org/r1636334
Log:
Fix for CONNECTORS-1092.

Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1636334&r1=1636333&r2=1636334&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Mon Nov  3 12:23:55 2014
@@ -3,6 +3,12 @@ $Id$
 
 ======================= 2.0-dev =====================
 
+CONNECTORS-1092: Error in log during load tests.
+(Karl Wright)
+
+CONNECTORS-1091: On job start, reprioritize documents.
+(Karl Wright)
+
 CONNECTORS-1090: More PostgreSQL performance improvements.
 (Karl Wright)
 

Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java?rev=1636334&r1=1636333&r2=1636334&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
(original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
Mon Nov  3 12:23:55 2014
@@ -660,30 +660,46 @@ public class JobManager implements IJobM
   public void assessMarkedJobs()
     throws ManifoldCFException
   {
-    database.beginTransaction();
-    try
-    {
-      // Query for all jobs marked "ASSESSMENT_UNKNOWN".
-      jobs.assessMarkedJobs();
-    }
-    catch (ManifoldCFException e)
-    {
-      database.signalRollback();
-      throw e;
-    }
-    catch (RuntimeException e)
-    {
-      database.signalRollback();
-      throw e;
-    }
-    catch (Error e)
-    {
-      database.signalRollback();
-      throw e;
-    }
-    finally
+    while (true)
     {
-      database.endTransaction();
+      long sleepAmt = 0L;
+      database.beginTransaction();
+      try
+      {
+        // Query for all jobs marked "ASSESSMENT_UNKNOWN".
+        jobs.assessMarkedJobs();
+        database.performCommit();
+        break;
+      }
+      catch (ManifoldCFException e)
+      {
+        database.signalRollback();
+        if (e.getErrorCode() == e.DATABASE_TRANSACTION_ABORT)
+        {
+          if (Logging.perf.isDebugEnabled())
+            Logging.perf.debug("Aborted transaction assessing jobs: "+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);
+      }
     }
   }
 
@@ -904,6 +920,12 @@ public class JobManager implements IJobM
         }
         throw e;
       }
+      catch (RuntimeException e)
+      {
+        database.signalRollback();
+        TrackerClass.noteRollback();
+        throw e;
+      }
       catch (Error e)
       {
         database.signalRollback();



Mime
View raw message