YARN-4153. TestAsyncDispatcher failed at branch-2.7. Contributed by Zhihai Xu

This commit is contained in:
Jian He 2015-09-14 17:48:31 +08:00
parent 7d3e882a49
commit 30569d930f
3 changed files with 14 additions and 7 deletions

View File

@ -83,11 +83,13 @@ public class JvmPauseMonitor {
public void stop() {
shouldRun = false;
monitorThread.interrupt();
try {
monitorThread.join();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
if (monitorThread != null) {
monitorThread.interrupt();
try {
monitorThread.join();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
}

View File

@ -71,6 +71,8 @@ Release 2.7.2 - UNRELEASED
YARN-4096. App local logs are leaked if log aggregation fails to initialize
for the app. (Jason Lowe via zxu)
YARN-4153. TestAsyncDispatcher failed at branch-2.7 (Zhihai Xu via jianhe)
Release 2.7.1 - 2015-07-06
INCOMPATIBLE CHANGES

View File

@ -144,9 +144,12 @@ public class AsyncDispatcher extends AbstractService implements Dispatcher {
YarnConfiguration.DEFAULT_DISPATCHER_DRAIN_EVENTS_TIMEOUT);
synchronized (waitForDrained) {
while (!drained && eventHandlingThread.isAlive()) {
while (!drained && eventHandlingThread != null
&& eventHandlingThread.isAlive()
&& System.currentTimeMillis() < endTime) {
waitForDrained.wait(1000);
LOG.info("Waiting for AsyncDispatcher to drain.");
LOG.info("Waiting for AsyncDispatcher to drain. Thread state is :" +
eventHandlingThread.getState());
}
}
}