YARN-2917. Fixed potential deadlock when system.exit is called in AsyncDispatcher. Contributed by Rohith Sharmaks

(cherry picked from commit 614b6afea4)

(cherry picked from commit 41f0d20fcb)
(cherry picked from commit aa4f8184ee7aa1817a9b23b3b4e7e78da95dc031)
This commit is contained in:
Jian He 2014-12-11 11:16:45 -08:00 committed by Vinod Kumar Vavilapalli
parent 6e954bc25c
commit 3d5627b563
2 changed files with 16 additions and 2 deletions

View File

@ -42,6 +42,9 @@ Release 2.6.1 - UNRELEASED
YARN-2910. FSLeafQueue can throw ConcurrentModificationException. YARN-2910. FSLeafQueue can throw ConcurrentModificationException.
(Wilfred Spiegelenburg via kasha) (Wilfred Spiegelenburg via kasha)
YARN-2917. Fixed potential deadlock when system.exit is called in AsyncDispatcher
(Rohith Sharmaks via jianhe)
Release 2.6.0 - 2014-11-18 Release 2.6.0 - 2014-11-18
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -181,8 +181,9 @@ public class AsyncDispatcher extends AbstractService implements Dispatcher {
if (exitOnDispatchException if (exitOnDispatchException
&& (ShutdownHookManager.get().isShutdownInProgress()) == false && (ShutdownHookManager.get().isShutdownInProgress()) == false
&& stopped == false) { && stopped == false) {
LOG.info("Exiting, bbye.."); Thread shutDownThread = new Thread(createShutDownThread());
System.exit(-1); shutDownThread.setName("AsyncDispatcher ShutDown handler");
shutDownThread.start();
} }
} }
} }
@ -271,4 +272,14 @@ public class AsyncDispatcher extends AbstractService implements Dispatcher {
} }
} }
Runnable createShutDownThread() {
return new Runnable() {
@Override
public void run() {
LOG.info("Exiting, bbye..");
System.exit(-1);
}
};
}
} }