hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From varunsax...@apache.org
Subject hadoop git commit: YARN=5526. DrainDispacher#serviceStop blocked if setDrainEventsOnStop invoked (sandflee via Varun Saxena)
Date Thu, 18 Aug 2016 06:54:09 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 07d5ab16d -> 5fa7a14da


YARN=5526. DrainDispacher#serviceStop blocked if setDrainEventsOnStop invoked (sandflee via
Varun Saxena)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/5fa7a14d
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/5fa7a14d
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/5fa7a14d

Branch: refs/heads/branch-2
Commit: 5fa7a14da97872238fc17968835ad8c3c7af604a
Parents: 07d5ab1
Author: Varun Saxena <varunsaxena@apache.org>
Authored: Thu Aug 18 12:23:34 2016 +0530
Committer: Varun Saxena <varunsaxena@apache.org>
Committed: Thu Aug 18 12:23:34 2016 +0530

----------------------------------------------------------------------
 .../java/org/apache/hadoop/yarn/event/AsyncDispatcher.java     | 6 +++++-
 .../java/org/apache/hadoop/yarn/event/DrainDispatcher.java     | 5 +++++
 2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/5fa7a14d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/event/AsyncDispatcher.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/event/AsyncDispatcher.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/event/AsyncDispatcher.java
index 5dea1c8..89b5861 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/event/AsyncDispatcher.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/event/AsyncDispatcher.java
@@ -148,7 +148,7 @@ public class AsyncDispatcher extends AbstractService implements Dispatcher
{
               YarnConfiguration.DEFAULT_DISPATCHER_DRAIN_EVENTS_TIMEOUT);
 
       synchronized (waitForDrained) {
-        while (!drained && eventHandlingThread != null
+        while (!isDrained() && eventHandlingThread != null
             && eventHandlingThread.isAlive()
             && System.currentTimeMillis() < endTime) {
           waitForDrained.wait(1000);
@@ -303,4 +303,8 @@ public class AsyncDispatcher extends AbstractService implements Dispatcher
{
   protected boolean isEventThreadWaiting() {
     return eventHandlingThread.getState() == Thread.State.WAITING;
   }
+
+  protected boolean isDrained() {
+    return drained;
+  }
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/5fa7a14d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/event/DrainDispatcher.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/event/DrainDispatcher.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/event/DrainDispatcher.java
index cf4b1b5..f769492 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/event/DrainDispatcher.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/event/DrainDispatcher.java
@@ -95,6 +95,11 @@ public class DrainDispatcher extends AsyncDispatcher {
   }
 
   @Override
+  protected boolean isDrained() {
+    return drained;
+  }
+
+  @Override
   protected void serviceStop() throws Exception {
     stopped = true;
     super.serviceStop();


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message