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 2012/10/09 22:23:14 UTC

svn commit: r1396295 - in /manifoldcf/trunk: CHANGES.txt framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java

Author: kwright
Date: Tue Oct  9 20:23:13 2012
New Revision: 1396295

URL: http://svn.apache.org/viewvc?rev=1396295&view=rev
Log:
Fix for CONNECTORS-551.

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

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1396295&r1=1396294&r2=1396295&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Tue Oct  9 20:23:13 2012
@@ -3,6 +3,12 @@ $Id$
 
 ======================= 1.1-dev =====================
 
+CONNECTORS-551: Resetting agents process causes job's seed
+documents to be flipped into the PURGATORY state, which in turn
+may cause the documents to be deleted and the job to be shut down
+if the seed documents are the only documents.
+(Martin Gielow, Karl Wright)
+
 CONNECTORS-546: Rework the how-to-build-and-deploy documentation
 page to be clearer and also cover the combined war.
 (Karl Wright)

Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java?rev=1396295&r1=1396294&r2=1396295&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java Tue Oct  9 20:23:13 2012
@@ -346,6 +346,7 @@ public class JobQueue extends org.apache
     performUpdate(map,"WHERE "+query,list,null);
 
     // Map newseed fields to seed
+    map.clear();
     map.put(isSeedField,seedstatusToString(SEEDSTATUS_SEED));
     list.clear();
     query = buildConjunctionClause(list,new ClauseDescription[]{
@@ -354,7 +355,7 @@ public class JobQueue extends org.apache
 
     // Clear out all failtime fields (since we obviously haven't been retrying whilst we were not
     // running)
-    map = new HashMap();
+    map.clear();
     map.put(failTimeField,null);
     list.clear();
     query = buildConjunctionClause(list,new ClauseDescription[]{
@@ -542,7 +543,7 @@ public class JobQueue extends org.apache
       new UnitaryClause(statusField,statusToString(STATUS_PENDING))});
     performDelete("WHERE "+query,list,null);
 
-    // Turn PENDINGPURGATORY, COMPLETED into PURGATORY.
+    // Turn PENDINGPURGATORY and COMPLETED into PURGATORY.
     HashMap map = new HashMap();
     map.put(statusField,statusToString(STATUS_PURGATORY));
     map.put(checkTimeField,new Long(0L));
@@ -553,7 +554,7 @@ public class JobQueue extends org.apache
     // than being set back to some arbitrary value.
     // The alternative, which would be to reprioritize all the documents at this point, is somewhat attractive, but let's see if we can get away
     // without for now.
-
+      
     list.clear();
     query = buildConjunctionClause(list,new ClauseDescription[]{
       new UnitaryClause(jobIDField,jobID),