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 2018/06/21 00:42:08 UTC
svn commit: r1833965 -
/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java
Author: kwright
Date: Thu Jun 21 00:42:08 2018
New Revision: 1833965
URL: http://svn.apache.org/viewvc?rev=1833965&view=rev
Log:
Another fix for CONNECTORS-1507-3.
Modified:
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java
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=1833965&r1=1833964&r2=1833965&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 Thu Jun 21 00:42:08 2018
@@ -1151,12 +1151,29 @@ public class JobQueue extends org.apache
map.put(failCountField,null);
else
map.put(failCountField,new Long(failCount));
- // This does not need to set docPriorityField, because we want to preserve whatever
- // priority was in place from before.
+ // We don't know whether the document was processed or not, but we do know it was
+ // put into the Active state. Therefore, the document priority might have been cleared out.
+ // To cover that case, we need to make sure that the document priority gets reset at some point.
+ // NOTE WELL: We could be giving the document a new priority right here, but doing that
+ // would complicate a number of threads that use this method enormously, and this is a relatively
+ // rare situation. So we just hand such documents to the reprioritizer thread and let it fill in the document priority.
+
+ // First update: for those who have an intact doc priority.
ArrayList list = new ArrayList();
String query = buildConjunctionClause(list,new ClauseDescription[]{
- new UnitaryClause(idField,id)});
+ new UnitaryClause(idField,id),
+ new UnitaryClause(docPriorityField,"<",nullDocPriority)});
performUpdate(map,"WHERE "+query,list,null);
+
+ // Second update: for rows whose doc priority has been nulled out
+ map.put(needPriorityField,needPriorityToString(NEEDPRIORITY_TRUE));
+ map.put(needPriorityProcessIDField,null);
+ list.clear();
+ query = buildConjunctionClause(list,new ClauseDescription[]{
+ new UnitaryClause(idField,id),
+ new UnitaryClause(docPriorityField,nullDocPriority)});
+ performUpdate(map,"WHERE "+query,list,null);
+
noteModifications(0,1,0);
TrackerClass.noteRecordChange(id, STATUS_PENDINGPURGATORY, "Set requeued status");
}