hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From junping...@apache.org
Subject hadoop git commit: YARN-2749. Fix some testcases from TestLogAggregationService fails in trunk. (Contributed by Xuan Gong) (cherry picked from commit ab0b958a522d502426b91b6e4ab6dd29caccc372)
Date Sun, 15 Feb 2015 14:35:18 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 701112577 -> eee89bd18


YARN-2749. Fix some testcases from TestLogAggregationService fails in trunk. (Contributed
by Xuan Gong)
(cherry picked from commit ab0b958a522d502426b91b6e4ab6dd29caccc372)


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

Branch: refs/heads/branch-2
Commit: eee89bd18c0c82f14f76058b0000093a1ecce205
Parents: 7011125
Author: Junping Du <junping_du@apache.org>
Authored: Sun Feb 15 06:46:32 2015 -0800
Committer: Junping Du <junping_du@apache.org>
Committed: Sun Feb 15 06:48:29 2015 -0800

----------------------------------------------------------------------
 hadoop-yarn-project/CHANGES.txt                      |  3 +++
 .../logaggregation/AppLogAggregatorImpl.java         | 15 +++++++++++++++
 2 files changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/eee89bd1/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index 191a03c..61bc122 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -563,6 +563,9 @@ Release 2.7.0 - UNRELEASED
     YARN-2899. Run TestDockerContainerExecutorWithMocks on Linux only.
     (Ming Ma via cnauroth)
 
+    YARN-2749. Fix some testcases from TestLogAggregationService fails in trunk. 
+    (Xuan Gong via junping_du)
+
 Release 2.6.0 - 2014-11-18
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/eee89bd1/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/AppLogAggregatorImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/AppLogAggregatorImpl.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/AppLogAggregatorImpl.java
index 20887b6..8eb00f4 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/AppLogAggregatorImpl.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/AppLogAggregatorImpl.java
@@ -117,6 +117,8 @@ public class AppLogAggregatorImpl implements AppLogAggregator {
   private final int retentionSize;
   private final long rollingMonitorInterval;
   private final NodeId nodeId;
+  // This variable is only for testing
+  private final AtomicBoolean waiting = new AtomicBoolean(false);
 
   private final Map<ContainerId, ContainerLogAggregator> containerLogAggregators =
       new HashMap<ContainerId, ContainerLogAggregator>();
@@ -391,6 +393,7 @@ public class AppLogAggregatorImpl implements AppLogAggregator {
     while (!this.appFinishing.get() && !this.aborted.get()) {
       synchronized(this) {
         try {
+          waiting.set(true);
           if (this.rollingMonitorInterval > 0) {
             wait(this.rollingMonitorInterval * 1000);
             if (this.appFinishing.get() || this.aborted.get()) {
@@ -507,7 +510,19 @@ public class AppLogAggregatorImpl implements AppLogAggregator {
 
   @Private
   @VisibleForTesting
+  // This is only used for testing.
+  // This will wake the log aggregation thread that is waiting for
+  // rollingMonitorInterval.
+  // To use this method, make sure the log aggregation thread is running
+  // and waiting for rollingMonitorInterval.
   public synchronized void doLogAggregationOutOfBand() {
+    while(!waiting.get()) {
+      try {
+        wait(200);
+      } catch (InterruptedException e) {
+        // Do Nothing
+      }
+    }
     LOG.info("Do OutOfBand log aggregation");
     this.notifyAll();
   }


Mime
View raw message