소스 검색

Merge -r 752835:752836 from trunk onto branch 0.20. Fixes HADOOP-5440.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.19@752838 13f79535-47bb-0310-9956-ffa450edef68
Devaraj Das 16 년 전
부모
커밋
9e2816eba0
2개의 변경된 파일12개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 0
      CHANGES.txt
  2. 8 1
      src/mapred/org/apache/hadoop/mapred/TaskTracker.java

+ 4 - 0
CHANGES.txt

@@ -64,6 +64,10 @@ Release 0.19.2 - Unreleased
     HADOOP-5333. libhdfs supports appending to files. (dhruba)
 
     HADOOP-3998. Fix dfsclient exception when JVM is shutdown. (dhruba)
+
+    HADOOP-5440. Fixes a problem to do with removing a taskId from the list
+    of taskIds that the TaskTracker's TaskMemoryManager manages.
+    (Amareshwari Sriramadasu via ddas)
  
 Release 0.19.1 - 2009-02-23
 

+ 8 - 1
src/mapred/org/apache/hadoop/mapred/TaskTracker.java

@@ -2082,11 +2082,18 @@ public class TaskTracker
       //
       boolean needCleanup = false;
       synchronized (this) {
+        // Remove the task from MemoryManager, if the task SUCCEEDED or FAILED.
+        // KILLED tasks are removed in method kill(), because Kill 
+        // would result in launching a cleanup attempt before 
+        // TaskRunner returns; if remove happens here, it would remove
+        // wrong task from memory manager.
+        if (done || !wasKilled) {
+          removeFromMemoryManager(task.getTaskID());
+        }
         if (!done) {
           if (!wasKilled) {
             failures += 1;
             setTaskFailState(true);
-            removeFromMemoryManager(task.getTaskID());
             // call the script here for the failed tasks.
             if (debugCommand != null) {
               String taskStdout ="";