hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r735764 - in /hadoop/core/trunk: CHANGES.txt src/mapred/org/apache/hadoop/mapred/JvmManager.java src/mapred/org/apache/hadoop/mapred/TaskTracker.java
Date Mon, 19 Jan 2009 18:07:13 GMT
Author: ddas
Date: Mon Jan 19 10:07:13 2009
New Revision: 735764

URL: http://svn.apache.org/viewvc?rev=735764&view=rev
Log:
HADOOP-4967. Fixes a race condition in the JvmManager to do with killing tasks. Contributed
by Devaraj Das.

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

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=735764&r1=735763&r2=735764&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Mon Jan 19 10:07:13 2009
@@ -665,6 +665,9 @@
 
     HADOOP-4965. TestFileAppend3 should close FileSystem. (shv)
 
+    HADOOP-4967. Fixes a race condition in the JvmManager to do with killing
+    tasks. (ddas)
+
 Release 0.19.0 - 2008-11-18
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JvmManager.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JvmManager.java?rev=735764&r1=735763&r2=735764&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JvmManager.java (original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JvmManager.java Mon Jan 19 10:07:13
2009
@@ -195,6 +195,11 @@
     }
     private synchronized void reapJvm( 
         TaskRunner t, TaskTracker tracker, JvmEnv env) {
+      if (t.getTaskInProgress().wasKilled()) {
+        //the task was killed in-flight
+        //no need to do the rest of the operations
+        return;
+      }
       boolean spawnNewJvm = false;
       JobID jobId = t.getTask().getJobID();
       //Check whether there is a free slot to start a new JVM.

Modified: hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskTracker.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskTracker.java?rev=735764&r1=735763&r2=735764&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskTracker.java (original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskTracker.java Mon Jan 19 10:07:13
2009
@@ -1784,7 +1784,7 @@
     StringBuffer diagnosticInfo = new StringBuffer();
     private TaskRunner runner;
     volatile boolean done = false;
-    boolean wasKilled = false;
+    volatile boolean wasKilled = false;
     private JobConf defaultJobConf;
     private JobConf localJobConf;
     private boolean keepFailedTaskFiles;
@@ -2031,6 +2031,10 @@
       LOG.info("reported output size for " + task.getTaskID() +  "  was " + taskStatus.getOutputSize());
 
     }
+    
+    public boolean wasKilled() {
+      return wasKilled;
+    }
 
     /**
      * The task has actually finished running.



Mime
View raw message