Close processing triggered by shutdown hook isn't thread safe [SPR-13556] #18132
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
Andy Wilkinson opened SPR-13556 and commented
In
AbstractApplicationContext
,refresh
andclose
both synchronize onstartupShutdownMonitor
to prevent concurrent processing. However, when the application context's shutdown hook is performing the close processing this doesn't hold true as it doesn't synchronise onstartupShutdownMonitor
. This means it's possible for two close calls or a close and a refresh to occur in parallel.Affects: 4.1.7
Reference URL: spring-projects/spring-boot#4130
Issue Links:
Referenced from: commits 92dc51f, 57125c0
Backported to: 4.1.8
The text was updated successfully, but these errors were encountered: