Skip to content
Browse files
suppress explicit termination in main thread;
the shutdown hook is sufficient and it's a bit of work to terminate properly in-thread
  • Loading branch information
ahgittin committed Jan 20, 2016
1 parent db44cd7 commit 88b76b71bf7f977ee0c4185bba97e17ea0657baf
Showing 2 changed files with 9 additions and 6 deletions.
@@ -187,7 +187,9 @@ public void run() {
for (ManagementContext mgmt: managementContextsToStopAppsOnShutdown) {
if (mgmt.isRunning()) {

if (entitiesToStop.isEmpty()) {
@@ -482,11 +482,12 @@ public Void apply(CatalogInitialization catInit) {
waitAfterLaunch(mgmt, shutdownHandler);

// BrooklynShutdownHookJob will invoke terminate() to do mgmt.terminate() and BrooklynWebServer.stop();
// and System.exit is invoked immediately after ...
// but seems better to do it explicitly here.
// ('launcher' is local to us so the caller *cannot* do it, and no harm in doing it twice.)
// do not shutdown servers here here --
// the BrooklynShutdownHookJob will invoke that and others on System.exit()
// which happens immediately after.
// might be nice to do it explicitly here,
// but the server shutdown process has some special "shutdown apps" options
// so we'd want to refactor BrooklynShutdownHookJob to share code

return null;

0 comments on commit 88b76b7

Please sign in to comment.