hadoop-yarn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vino...@apache.org
Subject svn commit: r1578628 - in /hadoop/common/trunk/hadoop-yarn-project: ./ hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/event/ hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/ser...
Date Mon, 17 Mar 2014 22:17:43 GMT
Author: vinodkv
Date: Mon Mar 17 22:17:43 2014
New Revision: 1578628

URL: http://svn.apache.org/r1578628
Log:
YARN-1591. Fixed AsyncDispatcher to handle interrupts on shutdown in a sane manner and thus
fix failure of TestResourceTrackerService. Contributed by Tsuyoshi Ozawa.

Modified:
    hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt
    hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/event/AsyncDispatcher.java
    hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java
    hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestResourceTrackerService.java

Modified: hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt?rev=1578628&r1=1578627&r2=1578628&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt Mon Mar 17 22:17:43 2014
@@ -501,6 +501,10 @@ Release 2.4.0 - UNRELEASED
     YARN-1206. Fixed AM container log to show on NM web page after application
     finishes if log-aggregation is disabled. (Rohith Sharmaks via jianhe)
 
+    YARN-1591. Fixed AsyncDispatcher to handle interrupts on shutdown in a sane
+    manner and thus fix failure of TestResourceTrackerService. (Tsuyoshi Ozawa
+    via vinodkv)
+
 Release 2.3.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/event/AsyncDispatcher.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/event/AsyncDispatcher.java?rev=1578628&r1=1578627&r2=1578628&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/event/AsyncDispatcher.java
(original)
+++ hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/event/AsyncDispatcher.java
Mon Mar 17 22:17:43 2014
@@ -174,12 +174,13 @@ public class AsyncDispatcher extends Abs
       } else {
         throw new Exception("No handler for registered for " + type);
       }
-    }
-    catch (Throwable t) {
+    } catch (Throwable t) {
       //TODO Maybe log the state of the queue
       LOG.fatal("Error in dispatcher thread", t);
+      // If serviceStop is called, we should exit this thread gracefully.
       if (exitOnDispatchException
-          && (ShutdownHookManager.get().isShutdownInProgress()) == false) {
+          && (ShutdownHookManager.get().isShutdownInProgress()) == false
+          && stopped == false) {
         LOG.info("Exiting, bbye..");
         System.exit(-1);
       }

Modified: hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java?rev=1578628&r1=1578627&r2=1578628&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java
(original)
+++ hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java
Mon Mar 17 22:17:43 2014
@@ -630,7 +630,7 @@ public class ResourceManager extends Com
         }
         this.eventQueue.put(event);
       } catch (InterruptedException e) {
-        throw new YarnRuntimeException(e);
+        LOG.info("Interrupted. Trying to exit gracefully.");
       }
     }
   }

Modified: hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestResourceTrackerService.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestResourceTrackerService.java?rev=1578628&r1=1578627&r2=1578628&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestResourceTrackerService.java
(original)
+++ hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestResourceTrackerService.java
Mon Mar 17 22:17:43 2014
@@ -30,6 +30,8 @@ import org.junit.Assert;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.io.IOUtils;
+import org.apache.hadoop.metrics2.MetricsSystem;
+import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
 import org.apache.hadoop.net.NetUtils;
 import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
@@ -63,7 +65,7 @@ public class TestResourceTrackerService 
 
   private final static File TEMP_DIR = new File(System.getProperty(
       "test.build.data", "/tmp"), "decommision");
-  private File hostFile = new File(TEMP_DIR + File.separator + "hostFile.txt");
+  private final File hostFile = new File(TEMP_DIR + File.separator + "hostFile.txt");
   private MockRM rm;
 
   /**
@@ -468,7 +470,7 @@ public class TestResourceTrackerService 
 
   @Test
   public void testNodeRegistrationWithContainers() throws Exception {
-    MockRM rm = new MockRM();
+    rm = new MockRM();
     rm.init(new YarnConfiguration());
     rm.start();
     RMApp app = rm.submitApp(1024);
@@ -491,7 +493,7 @@ public class TestResourceTrackerService 
   @Test
   public void testReconnectNode() throws Exception {
     final DrainDispatcher dispatcher = new DrainDispatcher();
-    MockRM rm = new MockRM() {
+    rm = new MockRM() {
       @Override
       protected EventHandler<SchedulerEvent> createSchedulerEventDispatcher() {
         return new SchedulerEventDispatcher(this.scheduler) {
@@ -593,9 +595,15 @@ public class TestResourceTrackerService 
     if (hostFile != null && hostFile.exists()) {
       hostFile.delete();
     }
+
     ClusterMetrics.destroy();
     if (rm != null) {
       rm.stop();
     }
+
+    MetricsSystem ms = DefaultMetricsSystem.instance();
+    if (ms.getSource("ClusterMetrics") != null) {
+      DefaultMetricsSystem.shutdown();
+    }
   }
 }



Mime
View raw message