Github user neykov commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/1164#discussion_r50282384
--- Diff:
brooklyn-server/server-cli/src/main/java/org/apache/brooklyn/cli/Main.java ---
@@ -474,17 +472,22 @@ public Void apply(CatalogInitialization catInit) {
}
BrooklynServerDetails server = launcher.getServerDetails();
- ManagementContext ctx = server.getManagementContext();
+ ManagementContext mgmt = server.getManagementContext();
if (verbose) {
Entities.dumpInfo(launcher.getApplications());
}
if (!exitAndLeaveAppsRunningAfterStarting) {
- waitAfterLaunch(ctx, shutdownHandler);
+ waitAfterLaunch(mgmt, shutdownHandler);
}
- // will call mgmt.terminate() in BrooklynShutdownHookJob
+ // 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.)
+ launcher.terminate();
--- End diff --
Won't this get called before `BrooklynShutdownHookJob`, causing an
non-graceful exit?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---