Skip to content

Commit 92dc51f

Browse files
committed
Shutdown hook triggers doClose within startupShutdownMonitor
Issue: SPR-13556
1 parent 8b3b8d0 commit 92dc51f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,9 @@ public void registerShutdownHook() {
891891
this.shutdownHook = new Thread() {
892892
@Override
893893
public void run() {
894-
doClose();
894+
synchronized (startupShutdownMonitor) {
895+
doClose();
896+
}
895897
}
896898
};
897899
Runtime.getRuntime().addShutdownHook(this.shutdownHook);

0 commit comments

Comments
 (0)