You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ac...@apache.org on 2007/10/12 17:33:11 UTC

svn commit: r584187 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/TaskTracker.java

Author: acmurthy
Date: Fri Oct 12 08:33:10 2007
New Revision: 584187

URL: http://svn.apache.org/viewvc?rev=584187&view=rev
Log:
HADOOP-2016.  Ignore status-updates from FAILED/KILLED tasks at the TaskTracker. This fixes a race-condition which caused the tasks to wrongly remain in the RUNNING state even after being killed by the JobTracker and thus handicap the cleanup of the task's output sub-directory. Contributed by Arun.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?rev=584187&r1=584186&r2=584187&view=diff
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Fri Oct 12 08:33:10 2007
@@ -286,6 +286,11 @@
 
     HADOOP-2036. Fix a NullPointerException in JvmMetrics class. (nigel)
 
+    HADOOP-2016.  Ignore status-updates from FAILED/KILLED tasks at the 
+    TaskTracker. This fixes a race-condition which caused the tasks to wrongly 
+    remain in the RUNNING state even after being killed by the JobTracker and
+    thus handicap the cleanup of the task's output sub-directory. (acmurthy)
+
   IMPROVEMENTS
 
     HADOOP-1908. Restructure data node code so that block sending and 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java?rev=584187&r1=584186&r2=584187&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java Fri Oct 12 08:33:10 2007
@@ -1324,14 +1324,21 @@
      */
     public synchronized void reportProgress(TaskStatus taskStatus) 
     {
-      if (this.done) {
+      LOG.info(task.getTaskId() + " " + taskStatus.getProgress() + 
+          "% " + taskStatus.getStateString());
+      
+      if (this.done || 
+          this.taskStatus.getRunState() != TaskStatus.State.RUNNING) {
         //make sure we ignore progress messages after a task has 
-        //invoked TaskUmbilicalProtocol.done()
+        //invoked TaskUmbilicalProtocol.done() or if the task has been
+        //KILLED/FAILED
+        LOG.info(task.getTaskId() + " Ignoring status-update since " +
+                 ((this.done) ? "task is 'done'" : 
+                                ("runState: " + this.taskStatus.getRunState()))
+                 ); 
         return;
       }
       
-      LOG.info(task.getTaskId() + " " + taskStatus.getProgress() + 
-               "% " + taskStatus.getStateString());
       this.taskStatus.statusUpdate(taskStatus);
       this.lastProgressReport = System.currentTimeMillis();
     }