Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously, SpringApplicationShutdownHook would call close() on any registered application context even if it wasn't active as it had already been closed. This could lead to deadlock if the context was closed and System.exit was called during application context refresh. This commit updates SpringApplicationShutdownHook so that it only calls close() on active contexts. This prevents deadlock as it avoids trying to sychronize on the context's startupShutdownMonitor on the shutdown hook thread while it's still held on the main thread which called System.exit and is waiting for all of the shutdown hooks to complete. Fixes gh-27049
- Loading branch information
1 parent
05b041b
commit 5a9fa3c
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters