hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r704536 - in /hadoop/core/trunk: CHANGES.txt src/mapred/org/apache/hadoop/mapred/JobInProgress.java src/mapred/org/apache/hadoop/mapred/JobTracker.java src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
Date Tue, 14 Oct 2008 13:38:22 GMT
Author: ddas
Date: Tue Oct 14 06:38:21 2008
New Revision: 704536

URL: http://svn.apache.org/viewvc?rev=704536&view=rev
Log:
HADOOP-4361. Makes sure that jobs killed from command line are killed fast (i.e., there is
a slot to run the cleanup task soon). Contributed by Amareshwari Sriramadasu.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
    hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobTracker.java
    hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=704536&r1=704535&r2=704536&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Tue Oct 14 06:38:21 2008
@@ -898,6 +898,10 @@
     HADOOP-4287. Fixes an issue to do with maintaining counts of running/pending
     maps/reduces. (Sreekanth Ramakrishnan via ddas)
 
+    HADOOP-4361. Makes sure that jobs killed from command line are killed
+    fast (i.e., there is a slot to run the cleanup task soon).
+    (Amareshwari Sriramadasu via ddas)
+
 Release 0.18.2 - Unreleased
 
   BUG FIXES

Modified: hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobInProgress.java?rev=704536&r1=704535&r2=704536&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobInProgress.java (original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobInProgress.java Tue Oct 14 06:38:21
2008
@@ -858,7 +858,7 @@
                                             int clusterSize, 
                                             int numUniqueHosts
                                            ) throws IOException {
-    if (!tasksInited.get()) {
+    if (status.getRunState() != JobStatus.RUNNING) {
       LOG.info("Cannot create task split for " + profile.getJobID());
       return null;
     }
@@ -1016,7 +1016,7 @@
                                                int clusterSize,
                                                int numUniqueHosts
                                               ) throws IOException {
-    if (!tasksInited.get()) {
+    if (status.getRunState() != JobStatus.RUNNING) {
       LOG.info("Cannot create task split for " + profile.getJobID());
       return null;
     }
@@ -1918,6 +1918,9 @@
       //
       // kill all TIPs.
       //
+      for (int i = 0; i < setup.length; i++) {
+        setup[i].kill();
+      }
       for (int i = 0; i < maps.length; i++) {
         maps[i].kill();
       }

Modified: hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobTracker.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobTracker.java?rev=704536&r1=704535&r2=704536&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobTracker.java (original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobTracker.java Tue Oct 14 06:38:21
2008
@@ -2054,7 +2054,8 @@
           // It may be successfully completed, or may be killed in
           // mid-execution.
           //
-          if (tip.getJob().getStatus().getRunState() == JobStatus.RUNNING) {
+          if (tip.getJob().getStatus().getRunState() == JobStatus.RUNNING ||
+              tip.getJob().getStatus().getRunState() == JobStatus.PREP) {
             killList.add(new KillTaskAction(killTaskId));
             LOG.debug(taskTracker + " -> KillTaskAction: " + killTaskId);
           } else {
@@ -2619,7 +2620,8 @@
             (tip.isMapTask() && !tip.isSetupTask() && 
              job.desiredReduces() != 0)) {
           // if the job is done, we don't want to change anything
-          if (job.getStatus().getRunState() == JobStatus.RUNNING) {
+          if (job.getStatus().getRunState() == JobStatus.RUNNING ||
+              job.getStatus().getRunState() == JobStatus.PREP) {
             job.failedTask(tip, taskId, ("Lost task tracker: " + trackerName), 
                            (tip.isMapTask() ? 
                                TaskStatus.Phase.MAP : 

Modified: hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java?rev=704536&r1=704535&r2=704536&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java (original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java Tue Oct 14 06:38:21
2008
@@ -386,7 +386,9 @@
     TaskStatus ts = taskStatuses.get(taskid);
     if ((ts != null) &&
         (!tasksReportedClosed.contains(taskid)) &&
-        (job.getStatus().getRunState() != JobStatus.RUNNING)) {
+        ((this.failed) ||
+        ((job.getStatus().getRunState() != JobStatus.RUNNING &&
+         (job.getStatus().getRunState() != JobStatus.PREP))))) {
       tasksReportedClosed.add(taskid);
       close = true;
     } else if (isComplete() && 



Mime
View raw message