Author: kwright
Date: Wed Feb  5 15:30:28 2014
New Revision: 1564804

URL: http://svn.apache.org/r1564804
Log:
Fix for CONNECTORS-880

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

Propchange: manifoldcf/trunk/
------------------------------------------------------------------------------
  Merged /manifoldcf/branches/CONNECTORS-880:r1564439-1564786

Modified: manifoldcf/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1564804&r1=1564803&r2=1564804&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Wed Feb  5 15:30:28 2014
@@ -3,6 +3,10 @@ $Id$
 
 ======================= 1.6-dev =====================
 
+CONNECTORS-880: Fix handling of output connector errors during
+clean up phase.
+(Florian Schmedding, Karl Wright)
+
 CONNECTORS-878: Come up with a formula for allocating connections
 to pools when a connection bin is used by multiple pools.
 (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=1564804&r1=1564803&r2=1564804&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
 Wed Feb  5 15:30:28 2014
@@ -7300,6 +7300,7 @@ public class JobManager implements IJobM
           jobs.statusToString(jobs.STATUS_ABORTING),
           jobs.statusToString(jobs.STATUS_ABORTINGFORRESTART),
           jobs.statusToString(jobs.STATUS_ABORTINGFORRESTARTMINIMAL),
+          jobs.statusToString(jobs.STATUS_ABORTINGSHUTTINGDOWN),
           jobs.statusToString(jobs.STATUS_PAUSING),
           jobs.statusToString(jobs.STATUS_PAUSINGSEEDING),
           jobs.statusToString(jobs.STATUS_ACTIVEWAITING),
@@ -7318,7 +7319,7 @@ public class JobManager implements IJobM
 
       sb = new StringBuilder("SELECT ");
       list.clear();
-          
+
       sb.append(jobQueue.idField).append(" FROM 
").append(jobQueue.getTableName()).append(" WHERE ")
         .append(database.buildConjunctionClause(list,new ClauseDescription[]{
           new UnitaryClause(jobQueue.jobIDField,jobID),
@@ -7326,7 +7327,8 @@ public class JobManager implements IJobM
             jobQueue.statusToString(jobQueue.STATUS_ACTIVE),
             jobQueue.statusToString(jobQueue.STATUS_ACTIVEPURGATORY),
             jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCAN),
-            
jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCANPURGATORY)})}))
+            jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCANPURGATORY),
+            jobQueue.statusToString(jobQueue.STATUS_BEINGCLEANED)})}))
         .append(" ").append(database.constructOffsetLimitClause(0,1));
 
       IResultSet confirmSet = 
database.performQuery(sb.toString(),list,null,null,1,null);
@@ -7730,6 +7732,7 @@ public class JobManager implements IJobM
       case Jobs.STATUS_ABORTINGSEEDING:
       case Jobs.STATUS_ABORTINGSTARTINGUP:
       case Jobs.STATUS_ABORTINGSTARTINGUPMINIMAL:
+      case Jobs.STATUS_ABORTINGSHUTTINGDOWN:
         rstatus = JobStatus.JOBSTATUS_ABORTING;
         break;
       case Jobs.STATUS_ABORTINGFORRESTART:

Modified: 
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/Jobs.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/Jobs.java?rev=1564804&r1=1564803&r2=1564804&view=diff
==============================================================================
--- 
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/Jobs.java
 (original)
+++ 
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/Jobs.java
 Wed Feb  5 15:30:28 2014
@@ -112,6 +112,7 @@ public class Jobs extends org.apache.man
   public static final int STATUS_NOTIFYINGOFCOMPLETION = 34;    // Notifying 
connector of terminating job (either aborted, or finished)
   public static final int STATUS_DELETING = 35;                         // The 
job is deleting.
   public static final int STATUS_DELETESTARTINGUP = 36;         // The delete 
is starting up.
+  public static final int STATUS_ABORTINGSHUTTINGDOWN = 37;     // Aborting 
the cleanup phase.
   
   // These statuses have to do with whether a job has an installed underlying 
connector or not.
   // There are two reasons to have a special state here: (1) if the behavior 
of the crawler differs, or (2) if the
@@ -122,13 +123,13 @@ public class Jobs extends org.apache.man
   // But, since there is no indication in the jobs table of an uninstalled 
connector for such jobs, the code which starts
   // jobs up (or otherwise would enter any state that has a corresponding 
special state) must check to see if the underlying
   // connector exists before deciding what state to put the job into.
-  public static final int STATUS_ACTIVE_UNINSTALLED = 37;               // 
Active, but repository connector not installed
-  public static final int STATUS_ACTIVESEEDING_UNINSTALLED = 38;   // Active 
and seeding, but repository connector not installed
-  public static final int STATUS_ACTIVE_NOOUTPUT = 39;                  // 
Active, but output connector not installed
-  public static final int STATUS_ACTIVESEEDING_NOOUTPUT = 40;       // Active 
and seeding, but output connector not installed
-  public static final int STATUS_ACTIVE_NEITHER = 41;                     // 
Active, but neither repository connector nor output connector installed
-  public static final int STATUS_ACTIVESEEDING_NEITHER = 42;          // 
Active and seeding, but neither repository connector nor output connector 
installed
-  public static final int STATUS_DELETING_NOOUTPUT = 43;                // Job 
is being deleted but there's no output connector installed
+  public static final int STATUS_ACTIVE_UNINSTALLED = 38;               // 
Active, but repository connector not installed
+  public static final int STATUS_ACTIVESEEDING_UNINSTALLED = 39;   // Active 
and seeding, but repository connector not installed
+  public static final int STATUS_ACTIVE_NOOUTPUT = 40;                  // 
Active, but output connector not installed
+  public static final int STATUS_ACTIVESEEDING_NOOUTPUT = 41;       // Active 
and seeding, but output connector not installed
+  public static final int STATUS_ACTIVE_NEITHER = 42;                     // 
Active, but neither repository connector nor output connector installed
+  public static final int STATUS_ACTIVESEEDING_NEITHER = 43;          // 
Active and seeding, but neither repository connector nor output connector 
installed
+  public static final int STATUS_DELETING_NOOUTPUT = 44;                // Job 
is being deleted but there's no output connector installed
 
   // Type field values
   public static final int TYPE_CONTINUOUS = IJobDescription.TYPE_CONTINUOUS;
@@ -226,7 +227,8 @@ public class Jobs extends org.apache.man
     statusMap.put("z",new Integer(STATUS_PAUSEDWAITSEEDING));
     statusMap.put("y",new Integer(STATUS_ABORTINGFORRESTARTSEEDING));
     statusMap.put("m",new Integer(STATUS_ABORTINGFORRESTARTSEEDINGMINIMAL));
-
+    statusMap.put("q",new Integer(STATUS_ABORTINGSHUTTINGDOWN));
+    
     statusMap.put("H",new Integer(STATUS_ACTIVEWAITING));
     statusMap.put("h",new Integer(STATUS_ACTIVEWAITINGSEEDING));
     statusMap.put("F",new Integer(STATUS_PAUSING));
@@ -2024,11 +2026,15 @@ public class Jobs extends org.apache.man
     IResultRow row = set.getRow(0);
     int status = stringToStatus(row.getValue(statusField).toString());
     if (status == STATUS_ABORTING || status == STATUS_ABORTINGSEEDING ||
-      status == STATUS_ABORTINGSTARTINGUP || status == 
STATUS_ABORTINGSTARTINGUPMINIMAL)
+      status == STATUS_ABORTINGSTARTINGUP || status == 
STATUS_ABORTINGSTARTINGUPMINIMAL ||
+      status == STATUS_ABORTINGSHUTTINGDOWN)
       return false;
     int newStatus;
     switch (status)
     {
+    case STATUS_SHUTTINGDOWN:
+      newStatus = STATUS_ABORTINGSHUTTINGDOWN;
+      break;
     case STATUS_STARTINGUP:
     case STATUS_ABORTINGSTARTINGUPFORRESTART:
       newStatus = STATUS_ABORTINGSTARTINGUP;
@@ -2777,6 +2783,9 @@ public class Jobs extends org.apache.man
     case STATUS_RESUMINGSEEDING:
       return "i";
 
+    case STATUS_ABORTINGSHUTTINGDOWN:
+      return "q";
+
     default:
       throw new ManifoldCFException("Bad status value: 
"+Integer.toString(status));
     }


Reply via email to