浏览代码

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 年之前
父节点
当前提交
67de265e01
共有 2 个文件被更改,包括 15 次插入0 次删除
  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 
     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
 
   IMPROVEMENTS

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

@@ -535,6 +535,18 @@ class TaskInProgress {
            oldState == TaskStatus.State.COMMIT_PENDING)) {
         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;
     }