EHC ❯ Transactional cache with short TTI / TTL can provoke deadlocks
-
Bug
-
Status: Closed
-
2 Major
-
Resolution: Fixed
-
ehcache-core
-
-
lorban
-
Reporter: lorban
-
June 15, 2011
-
0
-
Watchers: 0
-
July 27, 2012
-
June 20, 2011
Attachments
Description
When a transactional cache (local, xa or xa_strict) is configured with a short TTI or TTL there’s a high probability to run into a deadlock.
Attached example app reproduces the problem.
See: http://forums.terracotta.org/forums/posts/list/5573.page
Comments
Ludovic Orban 2011-06-15
Ludovic Orban 2011-06-20
The proposed patch solves the issue and was confirmed by the user.
Fixed applied in trunk and 2.4.x branch.
The deadlock seems to be caused by a ‘lock leak’ which can happen when an inline eviction fails b/c of a transaction timeout.
Surrounding the eviction code with a try / finally block releasing the lock in the finally seems to solve the issue.