Browse Source

Merge -r 746969:746970 from trunk onto 0.20 branch. Fixes HADOOP-5280.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.20@746973 13f79535-47bb-0310-9956-ffa450edef68
Devaraj Das 16 năm trước cách đây
mục cha
commit
9e1ce9f72b

+ 3 - 0
CHANGES.txt

@@ -655,6 +655,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;
     }
     }