• 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
.github Loading commit data...
buildSrc Loading commit data...
ci Loading commit data...
eclipse Loading commit data...
git/hooks Loading commit data...
gradle/wrapper Loading commit data...
idea Loading commit data...
spring-boot-project Loading commit data...
spring-boot-tests Loading commit data...
src Loading commit data...
.editorconfig Loading commit data...
.gitignore Loading commit data...
CODE_OF_CONDUCT.adoc Loading commit data...
CONTRIBUTING.adoc Loading commit data...
LICENSE.txt Loading commit data...
README.adoc Loading commit data...
SUPPORT.adoc Loading commit data...
build.gradle Loading commit data...
gradle.properties Loading commit data...
gradlew Loading commit data...
gradlew.bat Loading commit data...
settings.gradle Loading commit data...