-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Deadlock when BoundedLocalCache.scheduleDrainBuffers throws an exception #130
Comments
Thanks for the investigative work! You're absolutely correct that I forgot about this scenario. I must have only considered reentrancy if the executor threw a In the mean time, as I am sure you know, you can use a non-FJP executor or even |
I plan on releasing this tomorrow and will update you when its published. Thanks again for reporting and debugging the issue. |
HuntBugs is the unofficial successor to Findbugs on a clean code base. The remaining warnings are all false positives and not sure how to suppress individually. It did find a few mistakes where the array was checked for null, rather than its element (weak key null guard). See https://github.com/amaembo/huntbugs for details.
Released 2.3.5 |
Used version: 2.3.2
In an error situation, we noticed a deadlock during call to cache's get method. We have no clear stacks to show the actual deadlock, but according to the log, an OutOfMemoryError was catched by BoundedLocalCache.scheduleDrainBuffers().
It seems that if no executor is defined for the cache it uses ForkJoinPool and with ForkJoinPool, cache's evictionLock is a NonReentrantLock which by its documentation will deadlock if called recursively.
If scheduleDrainBuffers throws an exception, performCleanup is called inside the catch-block while still holding the evictionLock. And since the performCleanup calls evictionLock.lock() on its first line, it seems that a deadlock is unavoidable in this scenario?
The text was updated successfully, but these errors were encountered: