Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: EE-1.8.2.GA_P08
-
Fix Version/s: EE-1.8.2.GA_P09
-
Component/s: Framework
-
Labels:None
-
Environment:Tomcat, OC4J
-
Assignee Priority:P1
-
Support Case References:Support case #13482 and #13486
Description
On session expiry coupled with a page redirect causes the framework to lockup with the following thread dump:
Found one Java-level deadlock:
=============================
"Session Monitor":
waiting to lock monitor 0x003e4b9c (object 0x0a2a03a0, a java.util.HashMap),
which is held by "HTTPThreadGroup-6"
"HTTPThreadGroup-6":
waiting to lock monitor 0x003e4bbc (object 0x0acf4880, a com.evermind.server.http.EvermindHttpSession),
which is held by "Session Monitor"
Java stack information for the threads listed above:
===================================================
"Session Monitor":
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.notifySessionShutdown(SessionDispatcher.java:272)
- waiting to lock <0x0a2a03a0> (a java.util.HashMap)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.access$400(SessionDispatcher.java:73)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$Listener.sessionDestroyed(SessionDispatcher.java:361)
at com.icesoft.faces.util.event.servlet.ContextEventRepeater.sessionDestroyed(ContextEventRepeater.java:319)
at com.evermind.server.http.HttpApplication.invalidateSession(HttpApplication.java:996)
at com.evermind.server.http.HttpApplication.invalidateSession(HttpApplication.java:978)
at com.evermind.server.http.EvermindHttpSession.invalidate(EvermindHttpSession.java:411)
- locked <0x0acf4880> (a com.evermind.server.http.EvermindHttpSession)
at com.evermind.server.http.EvermindHttpSession.invalidate(EvermindHttpSession.java:378)
- locked <0x0acf4880> (a com.evermind.server.http.EvermindHttpSession)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$Monitor.shutdown(SessionDispatcher.java:445)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$Monitor.shutdownIfExpired(SessionDispatcher.java:457)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$Listener$1.run(SessionDispatcher.java:325)
"HTTPThreadGroup-6":
at com.evermind.server.http.EvermindHttpSession.setAttribute(EvermindHttpSession.java:171)
- waiting to lock <0x0acf4880> (a com.evermind.server.http.EvermindHttpSession)
at com.evermind.server.http.EvermindHttpSession.setAttribute(EvermindHttpSession.java:137)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$Monitor.<init>(SessionDispatcher.java:388)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.checkSession(SessionDispatcher.java:136)
- locked <0x0a2a03a0> (a java.util.HashMap)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:96)
at com.icesoft.faces.webapp.http.servlet.BlockExpiredSessionRequests.service(BlockExpiredSessionRequests.java:53)
at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:55)
at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:204)
at ***.***Servlet.service(***Servlet.java:149)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:734)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:391)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:908)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:226)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:127)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:116)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
Found 1 deadlock.
Found one Java-level deadlock:
=============================
"Session Monitor":
waiting to lock monitor 0x003e4b9c (object 0x0a2a03a0, a java.util.HashMap),
which is held by "HTTPThreadGroup-6"
"HTTPThreadGroup-6":
waiting to lock monitor 0x003e4bbc (object 0x0acf4880, a com.evermind.server.http.EvermindHttpSession),
which is held by "Session Monitor"
Java stack information for the threads listed above:
===================================================
"Session Monitor":
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.notifySessionShutdown(SessionDispatcher.java:272)
- waiting to lock <0x0a2a03a0> (a java.util.HashMap)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.access$400(SessionDispatcher.java:73)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$Listener.sessionDestroyed(SessionDispatcher.java:361)
at com.icesoft.faces.util.event.servlet.ContextEventRepeater.sessionDestroyed(ContextEventRepeater.java:319)
at com.evermind.server.http.HttpApplication.invalidateSession(HttpApplication.java:996)
at com.evermind.server.http.HttpApplication.invalidateSession(HttpApplication.java:978)
at com.evermind.server.http.EvermindHttpSession.invalidate(EvermindHttpSession.java:411)
- locked <0x0acf4880> (a com.evermind.server.http.EvermindHttpSession)
at com.evermind.server.http.EvermindHttpSession.invalidate(EvermindHttpSession.java:378)
- locked <0x0acf4880> (a com.evermind.server.http.EvermindHttpSession)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$Monitor.shutdown(SessionDispatcher.java:445)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$Monitor.shutdownIfExpired(SessionDispatcher.java:457)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$Listener$1.run(SessionDispatcher.java:325)
"HTTPThreadGroup-6":
at com.evermind.server.http.EvermindHttpSession.setAttribute(EvermindHttpSession.java:171)
- waiting to lock <0x0acf4880> (a com.evermind.server.http.EvermindHttpSession)
at com.evermind.server.http.EvermindHttpSession.setAttribute(EvermindHttpSession.java:137)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$Monitor.<init>(SessionDispatcher.java:388)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.checkSession(SessionDispatcher.java:136)
- locked <0x0a2a03a0> (a java.util.HashMap)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:96)
at com.icesoft.faces.webapp.http.servlet.BlockExpiredSessionRequests.service(BlockExpiredSessionRequests.java:53)
at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:55)
at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:204)
at ***.***Servlet.service(***Servlet.java:149)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:734)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:391)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:908)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:226)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:127)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:116)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
Found 1 deadlock.
Modified SessionDispatcher.checkSession method to associate the monitor to the session outside the synchronized block thus avoiding potential deadlocks when HttpSession implementation is synchronized.