Return early if LifecycleManager#stopServices() is called twice.

This could happen if the app shuts down spontaneously (eg due to low memory) concurrently with a manual shutdown.
This commit is contained in:
akwizgran
2021-11-17 15:38:44 +00:00
parent 1b4ab4f945
commit 47085722da
2 changed files with 45 additions and 0 deletions

View File

@@ -190,6 +190,10 @@ class LifecycleManagerImpl implements LifecycleManager, MigrationListener {
return;
}
try {
if (state == STOPPING) {
LOG.info("Already stopped");
return;
}
LOG.info("Stopping services");
state = STOPPING;
eventBus.broadcast(new LifecycleEvent(STOPPING));