hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1079181 - in /hadoop/mapreduce/branches/yahoo-merge/src/java/org/apache/hadoop/mapred: TaskMemoryManagerThread.java TaskTracker.java
Date Tue, 08 Mar 2011 05:52:49 GMT
Author: omalley
Date: Tue Mar  8 05:52:48 2011
New Revision: 1079181

URL: http://svn.apache.org/viewvc?rev=1079181&view=rev
Log:
commit 3558a8bc79e9aed49e4d17e8cd1ec2c421d0c57b
Author: Mahadev Konar <mahadev@yahoo-inc.com>
Date:   Fri Oct 29 17:47:04 2010 -0700

     Uncaught exception in TaskMemoryManager in hadoop-0.22 (Krishna Ramachandran via mahadev)
from
    
    +++ b/YAHOO-CHANGES.txt
    +   Uncaught exception in TaskMemoryManager in hadoop-0.22 (Krishna Ramachandran via mahadev)
    +  from

Modified:
    hadoop/mapreduce/branches/yahoo-merge/src/java/org/apache/hadoop/mapred/TaskMemoryManagerThread.java
    hadoop/mapreduce/branches/yahoo-merge/src/java/org/apache/hadoop/mapred/TaskTracker.java

Modified: hadoop/mapreduce/branches/yahoo-merge/src/java/org/apache/hadoop/mapred/TaskMemoryManagerThread.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/yahoo-merge/src/java/org/apache/hadoop/mapred/TaskMemoryManagerThread.java?rev=1079181&r1=1079180&r2=1079181&view=diff
==============================================================================
--- hadoop/mapreduce/branches/yahoo-merge/src/java/org/apache/hadoop/mapred/TaskMemoryManagerThread.java
(original)
+++ hadoop/mapreduce/branches/yahoo-merge/src/java/org/apache/hadoop/mapred/TaskMemoryManagerThread.java
Tue Mar  8 05:52:48 2011
@@ -227,8 +227,12 @@ class TaskMemoryManagerThread extends Th
             continue; // processTree cannot be tracked
           }
 
-          if (taskTracker.runningTasks.get(tid).wasKilled()) {
-            continue; // this task has been killed already
+          TaskInProgress tip = taskTracker.getRunningTask(tid);
+          if (tip == null) {
+            continue;
+          }
+          if (tip.wasKilled()) {
+            continue;
           }
 
           LOG.debug("Constructing ProcessTree for : PID = " + pId + " TID = "
@@ -514,6 +518,12 @@ class TaskMemoryManagerThread extends Th
    * @param msg diagnostics message
    */
   private void killTask(TaskAttemptID tid, String msg) {
+    TaskInProgress tip = taskTracker.getRunningTask(tid);
+    if (tip != null) {
+      //for the task identified to be killed update taskDiagnostic 
+      TaskStatus taskStatus = tip.getStatus();
+      taskStatus.setDiagnosticInfo(msg);
+    }
     // Kill the task and mark it as killed.
     taskTracker.cleanUpOverMemoryTask(tid, false, msg);
     // Now destroy the ProcessTree, remove it from monitoring map.
@@ -530,7 +540,7 @@ class TaskMemoryManagerThread extends Th
    * @return true if the task can be killed
    */
   private boolean isKillable(TaskAttemptID tid) {
-      TaskInProgress tip = taskTracker.runningTasks.get(tid);
+      TaskInProgress tip = taskTracker.getRunningTask(tid);
       return tip != null && !tip.wasKilled() &&
              (tip.getRunState() == TaskStatus.State.RUNNING ||
               tip.getRunState() == TaskStatus.State.COMMIT_PENDING);

Modified: hadoop/mapreduce/branches/yahoo-merge/src/java/org/apache/hadoop/mapred/TaskTracker.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/yahoo-merge/src/java/org/apache/hadoop/mapred/TaskTracker.java?rev=1079181&r1=1079180&r2=1079181&view=diff
==============================================================================
--- hadoop/mapreduce/branches/yahoo-merge/src/java/org/apache/hadoop/mapred/TaskTracker.java
(original)
+++ hadoop/mapreduce/branches/yahoo-merge/src/java/org/apache/hadoop/mapred/TaskTracker.java
Tue Mar  8 05:52:48 2011
@@ -4109,4 +4109,8 @@ public class TaskTracker 
     ACLsManager getACLsManager() {
       return aclsManager;
     }
+
+    synchronized TaskInProgress getRunningTask(TaskAttemptID tid) {
+      return runningTasks.get(tid);
+    }
 }



Mime
View raw message