hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acmur...@apache.org
Subject svn commit: r610523 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/TaskInProgress.java
Date Wed, 09 Jan 2008 19:39:52 GMT
Author: acmurthy
Date: Wed Jan  9 11:39:25 2008
New Revision: 610523

URL: http://svn.apache.org/viewvc?rev=610523&view=rev
Log:
HADOOP-1281. Ensure running tasks of completed map TIPs (e.g. speculative tasks) are killed
as soon as the TIP completed.

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

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?rev=610523&r1=610522&r2=610523&view=diff
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Wed Jan  9 11:39:25 2008
@@ -381,6 +381,9 @@
     HADOOP-2537. Make build process compatible with Ant 1.7.0.
     (Hrishikesh via nigel)
 
+    HADOOP-1281. Ensure running tasks of completed map TIPs (e.g. speculative
+    tasks) are killed as soon as the TIP completed. (acmurthy)
+
 Release 0.15.2 - 2008-01-02
 
   BUG FIXES

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskInProgress.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskInProgress.java?rev=610523&r1=610522&r2=610523&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskInProgress.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskInProgress.java Wed Jan  9 11:39:25
2008
@@ -320,23 +320,28 @@
    * or the task is killed by the user
    */
   public boolean shouldClose(String taskid) {
-    // If the thing has never been closed,
-    // and it belongs to this TIP,
-    // and this TIP is somehow FINISHED,
-    // then true
+    /**
+     * If the task hasn't been closed yet, and it belongs to a completed
+     * TaskInProgress close it.
+     * 
+     * However, for completed map tasks we do not close the task which
+     * actually was the one responsible for _completing_ the TaskInProgress. 
+     */
+    boolean close = false;
     TaskStatus ts = taskStatuses.get(taskid);
     if ((ts != null) &&
         (!tasksReportedClosed.contains(taskid)) &&
         (job.getStatus().getRunState() != JobStatus.RUNNING)) {
       tasksReportedClosed.add(taskid);
-      return true;
-    } else if (!isMapTask() && isComplete() && 
-               !tasksReportedClosed.contains(taskid)){
+      close = true;
+    } else if (isComplete() && !(isMapTask() && isComplete(taskid)) &&
+               !tasksReportedClosed.contains(taskid)) {
       tasksReportedClosed.add(taskid);
-      return true; 
+      close = true; 
     } else {
-      return tasksToKill.keySet().contains(taskid);
-    }
+      close = tasksToKill.keySet().contains(taskid);
+    }   
+    return close;
   }
 
   /**



Mime
View raw message