CDV ❯ local synchronization by spring web code can cause deadlocks
-
Bug
-
Status: Closed
-
2 Major
-
Resolution: Fixed
-
Sessions
-
-
hhuynh
-
Reporter: teck
-
September 08, 2010
-
0
-
Watchers: 0
-
July 27, 2012
-
December 20, 2010
Attachments
Description
I think this problem can only happen with unlocked sessions (ie. where the session lock isn’t held for the entire request). That is the default in express though.
Spring session scoped beans seem to be wrapped in a synchronization block that uses the session object as the lock. The attached thread dump shows a deadlock that can result. Look at threads TP-Processor42 and TP-Processor9
One solution is to make spring use a different mutex (see org.springframework.web.util.HttpSessionMutexListener). I think that works for serialized sessions at least.
I guess we really should be using an internal lock in SessionData to prevent any external code from using it as a lock
see also: http://forums.terracotta.org/forums/posts/list/4166.page