-
Notifications
You must be signed in to change notification settings - Fork 53
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
Stuck thread due to WeakHashMap #180
Comments
there's a Eclipselink createEntityManager call that's blocked on the HashMap java.lang.Thread.State: BLOCKED (on object monitor)
|
This is a different lock and a different map. I don't see how that would be related to Hibernate Validator. Can you post a full thread dump, with all the threads? |
…roviderListAction#providersPerClassloader `clearCache` was a static method and thus was synchronized on the class, while `getCachedValidationProviders`/`cacheValidationProviders` are instance methods and thus are synchronized on a particular instance. This means it was theoretically possible for `clearCache` and `getCachedValidationProviders`/`cacheValidationProviders` to access the providersPerClassloader map concurrently, which is a problem because WeakHashMap is not thread-safe. This may fix jakartaee#180, though it's hard to say without a proper thread dump showing what the cause of the deadlock was exactly. In any case, this will prevent synchronization issues for integrators that call Validation#clearDefaultValidationProviderResolverCache concurrently to Validation.DefaultValidationProviderResolver#getValidationProviders.
[STUCK] ExecuteThread: '134' for queue: 'weblogic.kernel.Default
|
That's not a full thread dump. That's just one thread. |
I cannot share the full thread dump here. |
I see. Well, I can't debug a deadlock from information about a single thread, since a deadlock obviously involves multiple threads. Hopefully you will be able to pinpoint all threads involved in the deadlock and post the stacktraces of those. Good luck :) |
Stuck threads at
(self-tuning)'" #262 daemon prio=1 os_prio=0 tid=0x00007f1480091000
nid=0x187a runnable [0x00007f1456863000]
java.lang.Thread.State: RUNNABLE
at java.util.WeakHashMap.get(WeakHashMap.java:403)
at
javax.validation.Validation$GetValidationProviderListAction.getCachedValidatio
nProviders(Validation.java:368)
javax.validation.Validation$GetValidationProviderListAction)
at
javax.validation.Validation$GetValidationProviderListAction.run(Validation.jav
a:323)
at
javax.validation.Validation$GetValidationProviderListAction.getValidationProvi
derList(Validation.java:316)
at
javax.validation.Validation$DefaultValidationProviderResolver.getValidationPro
viders(Validation.java:299)
this is because WeakHashMap is not synchronized
The text was updated successfully, but these errors were encountered: