You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Spring's AbstractApplicationContext.registerShutdownHook() , it will register a shutdownhook to jvm. however, this shutdownhook is not threadsafe.
If we call AbstractApplicationContext.close(), it will stop all lifecycle beans in its context. however, as soon as all non-daemon threads have been stopped during applictioncontext.close(), jvm will shutdown itself and call shutdownhooks.
The issue is that AbstractApplicationContext.close() will also try to remove the shutdownhook from jvm, so close() will throw one exception java.lang.IllegalStateException: Shutdown in progress.