YARN=5526. DrainDispacher#serviceStop blocked if setDrainEventsOnStop invoked (sandflee via Varun Saxena)
This commit is contained in:
parent
07d5ab16df
commit
5fa7a14da9
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,6 +94,11 @@ public class DrainDispatcher extends AsyncDispatcher {
|
|||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isDrained() {
|
||||
return drained;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void serviceStop() throws Exception {
|
||||
stopped = true;
|
||||
|
|
Loading…
Reference in New Issue