Browse Source

HADOOP-5280. Adds a check to prevent a task state transition from FAILED to any of UNASSIGNED, RUNNING, COMMIT_PENDING or SUCCEEDED. Contributed by Devaraj Das.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@746970 13f79535-47bb-0310-9956-ffa450edef68
Devaraj Das 16 years ago
parent
commit
67de265e01
2 changed files with 15 additions and 0 deletions
  1. 3 0
      CHANGES.txt
  2. 12 0
      src/mapred/org/apache/hadoop/mapred/TaskInProgress.java

+ 3 - 0
CHANGES.txt

@@ -861,6 +861,9 @@ Release 0.20.0 - Unreleased
     the connector. The workaround patch takes the most conservative approach of 
     the connector. The workaround patch takes the most conservative approach of 
     killing the server process whenever this is true. (ddas)
     killing the server process whenever this is true. (ddas)
 
 
+    HADOOP-5280. Adds a check to prevent a task state transition from FAILED to any of
+    UNASSIGNED, RUNNING, COMMIT_PENDING or SUCCEEDED. (ddas) 
+
 Release 0.19.1 - Unreleased
 Release 0.19.1 - Unreleased
 
 
   IMPROVEMENTS
   IMPROVEMENTS

+ 12 - 0
src/mapred/org/apache/hadoop/mapred/TaskInProgress.java

@@ -535,6 +535,18 @@ class TaskInProgress {
            oldState == TaskStatus.State.COMMIT_PENDING)) {
            oldState == TaskStatus.State.COMMIT_PENDING)) {
         return false;
         return false;
       }
       }
+      
+      //This is to handle the case of the JobTracker timing out a task
+      //due to launch delay, but the TT comes back with one of the 
+      //states mentioned in the newState
+      if (oldState == TaskStatus.State.FAILED && 
+          (newState == TaskStatus.State.UNASSIGNED ||
+           newState == TaskStatus.State.RUNNING || 
+           newState == TaskStatus.State.COMMIT_PENDING ||
+           newState == TaskStatus.State.SUCCEEDED)) {
+        tasksToKill.put(taskid, true);
+        return false;	  
+      }
           
           
       changed = oldState != newState;
       changed = oldState != newState;
     }
     }