EHC ❯ Unnecessary locking in BlockingCache causes deadlock due to lock upgrade when attempting inline removal of expired Elements
-
Bug
-
Status: Closed
-
2 Major
-
Resolution: Fixed
-
ehcache-core
-
-
hsingh
-
Reporter: cdennis
-
May 11, 2010
-
0
-
Watchers: 0
-
January 17, 2013
-
May 11, 2010
Description
When attempting to remove an expired element during a get, we try to take the write lock. BlockingCache was being greedy and holding a read lock over the whole cache.get which leads to expiry removals being lock upgrades which deadlock.
BlockingCacheTest.testNoDeadlockOnRemovingExpiredElement() passes.