You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by bi...@apache.org on 2019/08/21 11:45:18 UTC
[hadoop] branch trunk updated: YARN-5857.
TestLogAggregationService.testFixedSizeThreadPool fails intermittently on
trunk. Contributed by Bilwa S T.
This is an automated email from the ASF dual-hosted git repository.
bibinchundatt pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new e684b17 YARN-5857. TestLogAggregationService.testFixedSizeThreadPool fails intermittently on trunk. Contributed by Bilwa S T.
e684b17 is described below
commit e684b17e6ff708bbd6c43bbd048dc73986b570e0
Author: bibinchundatt <bi...@apache.org>
AuthorDate: Wed Aug 21 17:14:42 2019 +0530
YARN-5857. TestLogAggregationService.testFixedSizeThreadPool fails intermittently on trunk. Contributed by Bilwa S T.
---
.../containermanager/logaggregation/TestLogAggregationService.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java
index 0e36682..063215e 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java
@@ -58,6 +58,7 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@@ -1215,6 +1216,8 @@ public class TestLogAggregationService extends BaseContainerManagerTest {
ExecutorService executorService = logAggregationService.threadPool;
+ CountDownLatch latch = new CountDownLatch(threadPoolSize);
+
// used to block threads in the thread pool because main thread always
// acquires the write lock first.
final ReadWriteLock rwLock = new ReentrantReadWriteLock();
@@ -1227,8 +1230,9 @@ public class TestLogAggregationService extends BaseContainerManagerTest {
@Override
public void run() {
try {
+ latch.countDown();
// threads in the thread pool running this will be blocked
- rLock.tryLock(35000, TimeUnit.MILLISECONDS);
+ rLock.tryLock(15000, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
@@ -1244,6 +1248,7 @@ public class TestLogAggregationService extends BaseContainerManagerTest {
executorService.submit(runnable);
}
+ latch.await();
// count the number of current running LogAggregationService threads
int runningThread = ((ThreadPoolExecutor) executorService).getActiveCount();
assertEquals(threadPoolSize, runningThread);
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org