Index: src/main/org/jboss/web/tomcat/service/session/JBossCacheManager.java =================================================================== --- src/main/org/jboss/web/tomcat/service/session/JBossCacheManager.java (revision 114285) +++ src/main/org/jboss/web/tomcat/service/session/JBossCacheManager.java (working copy) @@ -1122,47 +1122,14 @@ // session will be null, but we'll have a TimeStatistic to clean up stats_.removeStats(realId); } - else + else { - // Expire the session - // DON'T SYNCHRONIZE ON SESSION HERE -- isValid() and - // expire() are meant to be multi-threaded and synchronize - // properly internally; synchronizing externally can lead - // to deadlocks!! - boolean notify = false; // Don't notify listeners. SRV.10.7 - // allows this, and sending notifications - // leads to all sorts of issues; e.g. - // circular calls with ClusteredSSO and - // notifying when all that's happening is - // data gravitation due to random failover - boolean localCall = false; // this call originated from the cache; - // we have already removed session - boolean localOnly = true; // Don't pass attr removals to cache + // JBPAPP-10690 Don't call session expire as that can lead to deadlock + // Just do the bare minimum to remove the session + session.setValid(false); - // Ensure the correct TCL is in place - // BES 2008/11/27 Why? - ContextClassLoaderSwitcher.SwitchContext switcher = null; - try - { - // Don't track this invalidation is if it were from a request - SessionInvalidationTracker.suspend(); - - switcher = getContextClassLoaderSwitcher().getSwitchContext(); - switcher.setClassLoader(tcl_); - session.expire(notify, localCall, localOnly, ClusteredSessionNotificationCause.INVALIDATE); - } - finally - { - SessionInvalidationTracker.resume(); - - // Remove any stats for this session - stats_.removeStats(realId); - - if (switcher != null) - { - switcher.reset(); - } - } + // Remove any stats for this session + stats_.removeStats(realId); } }