Skip to content

Close processing triggered by shutdown hook isn't thread safe [SPR-13556] #18132

@spring-projects-issues

Description

@spring-projects-issues

Andy Wilkinson opened SPR-13556 and commented

In AbstractApplicationContext, refresh and close both synchronize on startupShutdownMonitor 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 on startupShutdownMonitor. 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

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions