• Andy Wilkinson's avatar
    Only close context that is active · 5a9fa3c8
    Andy Wilkinson authored
    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
    5a9fa3c8
Name
Last commit
Last update
..
spring-boot Loading commit data...
spring-boot-actuator Loading commit data...
spring-boot-actuator-autoconfigure Loading commit data...
spring-boot-autoconfigure Loading commit data...
spring-boot-cli Loading commit data...
spring-boot-dependencies Loading commit data...
spring-boot-devtools Loading commit data...
spring-boot-docs Loading commit data...
spring-boot-parent Loading commit data...
spring-boot-properties-migrator Loading commit data...
spring-boot-starters Loading commit data...
spring-boot-test Loading commit data...
spring-boot-test-autoconfigure Loading commit data...
spring-boot-tools Loading commit data...