Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid potential refresh deadlock with AbstractApplicationContext#registerShutdownHook #31811

Closed
snicoll opened this issue Dec 11, 2023 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Milestone

Comments

@snicoll
Copy link
Member

snicoll commented Dec 11, 2023

Originally reported in #29692.

Courtesy of @wilkinsona, looking at the original PR:

It looks to me like a better fix could be to only synchronize on startupShutdownMonitor while closed and active are being read or written so that those reads and writes are atomic.

@snicoll snicoll added type: bug A general bug in: core Issues in core modules (aop, beans, core, context, expression) labels Dec 11, 2023
@snicoll snicoll added this to the 6.x Backlog milestone Dec 11, 2023
@jhoeller jhoeller self-assigned this Dec 11, 2023
@jhoeller jhoeller modified the milestones: 6.x Backlog, 6.1.2 Dec 11, 2023
@jhoeller jhoeller changed the title Fix locking model in AbstractApplicationContext#registerShutdownHook Avoid refresh deadlock with AbstractApplicationContext#registerShutdownHook Dec 11, 2023
@jhoeller jhoeller changed the title Avoid refresh deadlock with AbstractApplicationContext#registerShutdownHook Avoid potential refresh deadlock with AbstractApplicationContext#registerShutdownHook Dec 11, 2023
@wilkinsona
Copy link
Member

wilkinsona commented Dec 12, 2023

These changes have broken this Spring Boot test.

Edit: I think I can modify the test to adapt to the change in the locking model with no adverse affects on the runtime behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants