Skip to content

Revisit datasource initialization so that no other component block on the EMF while it is being initialized #23740

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

Closed
snicoll opened this issue Oct 19, 2020 · 2 comments
Assignees
Labels
type: task A general task
Milestone

Comments

@snicoll
Copy link
Member

snicoll commented Oct 19, 2020

Fix for #23735 in 2.3.x.

Given that 2.3.5 has not been released yet, I am flagging this one as a task as a follow-up of #22852.

@snicoll
Copy link
Member Author

snicoll commented Oct 19, 2020

HibernateMetricsAutoConfiguration takes a map of String to EMF beans and register metrics. This happening with parallel initialisation means that a deadlock can be happening.

I've moved locally that code to SmartInitializingSingleton#afterSingletonsInstantiated and that did the trick for me but I'd like to confirm that this is the right approach before changing anything in 2.3.x.

snicoll added a commit to snicoll/spring-boot that referenced this issue Oct 20, 2020
@snicoll snicoll changed the title Revisit datasource initialization so that the event listener is fully initialized before the EMF lock applies. Revisit datasource initialization so that no other component block on the EMF while it is being initialized Oct 20, 2020
@snicoll snicoll self-assigned this Oct 20, 2020
@snicoll
Copy link
Member Author

snicoll commented Oct 20, 2020

I've reproduced the problem in our smoke test for JPA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

No branches or pull requests

1 participant