Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: EE-1.8.2.GA_P07
-
Fix Version/s: EE-1.8.2.GA_P08
-
Component/s: Framework
-
Labels:None
-
Environment:WebLogic Seam
-
Salesforce Case Reference:
Description
It appears we have interleaved synchronization that is causing a deadlock. It is triggered during session invalidation. In this case, something in Seam is invalidating the session and that invalidate call makes it's way down until we try to shutdown our SessionDispatcher.Monitor. At that point it grabs a lock on the collection of "contexts" in order to iterate through and clean up stuff. During this process, though, it needs to grap a lock on the SessionMonitors collection. Unfortunately, a thread already has the lock but then needs the lock on the "contexts" collection as well.
This is the invalidation thread involved in the deadlock:
And this is the other:
In thread '49', the session has been invalidated and the SessionDispatcher is attempting to shut down the Monitor for that session. In the process of doing that it grabs the lock on the contexts instance (a synchronized Set):
As part of notifySessionShutdown(), it wants to grab the lock for the SessionMonitors (a plain HashMap):
In thread '35', we see that it grabbed the lock for the SessionMonitors:
But as part of calling addInSessionContext(), it needs the lock on the contexts (a synchronized Set) instance being held by thread '49':
public void addInSessionContext(ServletContext context) { contexts.add(context); }
Subsequent request threads just start piling up waiting on the lock for the SessionMonitors: