Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/771#discussion_r35632448
--- Diff:
usage/rest-server/src/main/java/brooklyn/rest/resources/ServerResource.java ---
@@ -171,17 +207,22 @@ public void run() {
hasAppErrorsOrTimeout.set(true);
if (!terminateTried) {
- ((ManagementContextInternal)mgmt()).terminate();
+ ((ManagementContextInternal)mgmt).terminate();
}
} finally {
complete();
if (!hasAppErrorsOrTimeout.get() ||
forceShutdownOnError) {
- //give the http request a chance to complete
gracefully
+ //give the http request a chance to complete
gracefully, the server will be stopped in a shutdown hook
Time.sleep(delayForHttpReturn);
-
- System.exit(0);
+
+ if (shutdownRequestListener != null) {
+ shutdownRequestListener.onShutdownRequest();
+ } else {
+ log.warn("ShutdownRequestListener not set,
existing process");
--- End diff --
Should be "exiting process", instead of "existing process"?
---
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.
---