Skip to content

Add a per-bean-name lock around destroy/reset/re-populate/re-initialize steps in rebind - #1721

Merged
ryanjbaxter merged 1 commit into
spring-cloud:mainfrom
ryanjbaxter:fix-racecondition-with-rebinding
Aug 10, 2026
Merged

Add a per-bean-name lock around destroy/reset/re-populate/re-initialize steps in rebind#1721
ryanjbaxter merged 1 commit into
spring-cloud:mainfrom
ryanjbaxter:fix-racecondition-with-rebinding

Conversation

@ryanjbaxter

Copy link
Copy Markdown
Contributor

Fixes part of the issues originally reported in #1709

ConfigurationPropertiesRebinder had no synchronization at all, so two threads rebinding the same bean at the same time (for example a manual /actuator/refresh racing a config-watch-triggered refresh) could interleave their destroy/reset/re-populate/re-initialize steps on top of each other.

This adds a per-bean-name lock around that sequence in rebind(String, ApplicationContext), so concurrent rebinds of the same bean are now serialized instead of interleaved.

@github-project-automation github-project-automation Bot moved this to Todo in 2025.1.3 Aug 10, 2026
@ryanjbaxter ryanjbaxter added this to the 5.0.3 milestone Aug 10, 2026
@ryanjbaxter
ryanjbaxter merged commit 16b518d into spring-cloud:main Aug 10, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in 2025.1.3 Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant