hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomwh...@apache.org
Subject svn commit: r1082704 - in /hadoop/mapreduce/branches/branch-0.22: CHANGES.txt src/test/mapred/org/apache/hadoop/mapred/MiniMRCluster.java src/test/mapred/org/apache/hadoop/mapred/TestJobRetire.java
Date Thu, 17 Mar 2011 21:19:31 GMT
Author: tomwhite
Date: Thu Mar 17 21:19:30 2011
New Revision: 1082704

URL: http://svn.apache.org/viewvc?rev=1082704&view=rev
Log:
Merge -r 1082702:1082703 from trunk to branch-0.22. Fixes: MAPREDUCE-2392

Modified:
    hadoop/mapreduce/branches/branch-0.22/CHANGES.txt
    hadoop/mapreduce/branches/branch-0.22/src/test/mapred/org/apache/hadoop/mapred/MiniMRCluster.java
    hadoop/mapreduce/branches/branch-0.22/src/test/mapred/org/apache/hadoop/mapred/TestJobRetire.java

Modified: hadoop/mapreduce/branches/branch-0.22/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.22/CHANGES.txt?rev=1082704&r1=1082703&r2=1082704&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.22/CHANGES.txt (original)
+++ hadoop/mapreduce/branches/branch-0.22/CHANGES.txt Thu Mar 17 21:19:30 2011
@@ -513,6 +513,9 @@ Release 0.22.0 - Unreleased
     MAPREDUCE-2394. JUnit output format doesn't propagate into raid contrib
     build. (todd)
 
+    MAPREDUCE-2392. TaskTracker shutdown in the tests sometimes take 60s.
+    (tomwhite)
+
 Release 0.21.1 - Unreleased
 
   NEW FEATURES

Modified: hadoop/mapreduce/branches/branch-0.22/src/test/mapred/org/apache/hadoop/mapred/MiniMRCluster.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.22/src/test/mapred/org/apache/hadoop/mapred/MiniMRCluster.java?rev=1082704&r1=1082703&r2=1082704&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.22/src/test/mapred/org/apache/hadoop/mapred/MiniMRCluster.java
(original)
+++ hadoop/mapreduce/branches/branch-0.22/src/test/mapred/org/apache/hadoop/mapred/MiniMRCluster.java
Thu Mar 17 21:19:30 2011
@@ -689,7 +689,6 @@ public class MiniMRCluster {
     tracker.shutdown();
 
     Thread thread = taskTrackerThreadList.remove(id);
-    thread.interrupt();
     
     try {
       thread.join();
@@ -752,7 +751,6 @@ public class MiniMRCluster {
         TaskTrackerRunner taskTracker = taskTrackerList.get(idx);
         Thread taskTrackerThread = taskTrackerThreadList.get(idx);
         taskTracker.shutdown();
-        taskTrackerThread.interrupt();
         try {
           taskTrackerThread.join();
         } catch (InterruptedException ex) {

Modified: hadoop/mapreduce/branches/branch-0.22/src/test/mapred/org/apache/hadoop/mapred/TestJobRetire.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.22/src/test/mapred/org/apache/hadoop/mapred/TestJobRetire.java?rev=1082704&r1=1082703&r2=1082704&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.22/src/test/mapred/org/apache/hadoop/mapred/TestJobRetire.java
(original)
+++ hadoop/mapreduce/branches/branch-0.22/src/test/mapred/org/apache/hadoop/mapred/TestJobRetire.java
Thu Mar 17 21:19:30 2011
@@ -176,6 +176,8 @@ public class TestJobRetire extends TestC
    */
   class WaitingTaskTracker extends TaskTracker {
     
+    private volatile boolean alive = true;
+    
     WaitingTaskTracker(JobConf conf) throws IOException, InterruptedException {
       super(conf);
     }
@@ -185,8 +187,16 @@ public class TestJobRetire extends TestC
       HeartbeatResponse response = super.transmitHeartBeat(now);
       LOG.info("WaitingTaskTracker waiting");
       // wait forever
-      UtilsForTests.waitFor(Long.MAX_VALUE);
-      throw new IOException ("WaitingTaskTracker interrupted. Bailing out");
+      while (alive) {
+        UtilsForTests.waitFor(1000);
+      }
+      throw new IOException ("WaitingTaskTracker shutdown. Bailing out");
+    }
+    
+    @Override
+    public synchronized void shutdown() throws IOException {
+      alive = false;
+      super.shutdown();
     }
   }
   



Mime
View raw message