YARN-5809. AsyncDispatcher possibly invokes multiple shutdown threads when handling exception (Jian He via Varun Saxena)

This commit is contained in:
Varun Saxena 2016-11-01 04:20:22 +05:30
parent 6bb12ecc3f
commit 92b7491f23
1 changed files with 1 additions and 0 deletions

View File

@ -195,6 +195,7 @@ public class AsyncDispatcher extends AbstractService implements Dispatcher {
if (exitOnDispatchException if (exitOnDispatchException
&& (ShutdownHookManager.get().isShutdownInProgress()) == false && (ShutdownHookManager.get().isShutdownInProgress()) == false
&& stopped == false) { && stopped == false) {
stopped = true;
Thread shutDownThread = new Thread(createShutDownThread()); Thread shutDownThread = new Thread(createShutDownThread());
shutDownThread.setName("AsyncDispatcher ShutDown handler"); shutDownThread.setName("AsyncDispatcher ShutDown handler");
shutDownThread.start(); shutDownThread.start();