Skip to content

#133 Move constant class TypeDetails from interface to dedicated class #135

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

Merged
merged 1 commit into from
May 8, 2025

Conversation

mbellade
Copy link
Member

@mbellade mbellade commented May 8, 2025

Fixes #133.

Moving static constant ClassTypeDetailsImpl references to a dedicated class to avoid deadlocks waiting on <clinit> of the ClassBasedTypeDetails interface.

@mbellade mbellade requested a review from sebersole May 8, 2025 11:23
@sebersole
Copy link
Member

sebersole commented May 8, 2025

Looks good.

However, have you seen actual cases of this being a problem? The reason I ask is that we'd need a release of models and update orm to use it. But that new release would also include the work for #128, of which I am a little nervous about the performance impact.

@mbellade
Copy link
Member Author

mbellade commented May 8, 2025

Yeah, I've tried the reproducer provided here by Andres, which is fairly straightforward, and it confirmed the application got deadlocked waiting for ClassBasedTypeDetails. I've then tried applying these changes and the code execution finished in just a few moments.

The original report https://issues.redhat.com/browse/WFLY-20615 also says this can occur when using Wildfly and having 2 JPA applications deploying at the same time.

@sebersole
Copy link
Member

sebersole commented May 8, 2025

Ok, then we'll just have to hope #128 does not introduce a performance problem - all for a feature we are not even using in ORM yet ;)

@sebersole sebersole merged commit a530c4e into hibernate:main May 8, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deadlock on ClassBasedTypeDetails and ClassTypeDetailsImpl during concurrent startup
2 participants