Author: markt Date: Fri Apr 4 21:24:31 2014 New Revision: 1584919 URL: http://svn.apache.org/r1584919 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56339 Avoid an infinite loop if an application calls session.invalidate() from the session destroyed event for that session.
Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/StandardSession.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ ------------------------------------------------------------------------------ Merged /tomcat/trunk:r1584915 Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/StandardSession.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/StandardSession.java?rev=1584919&r1=1584918&r2=1584919&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/StandardSession.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/StandardSession.java Fri Apr 4 21:24:31 2014 @@ -760,7 +760,9 @@ public class StandardSession implements synchronized (this) { // Check again, now we are inside the sync so this code only runs once // Double check locking - isValid needs to be volatile - if (!isValid) + // The check of expiring is to ensure that an infinite loop is not + // entered as per bug 56339 + if (expiring || !isValid) return; if (manager == null) Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1584919&r1=1584918&r2=1584919&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Fri Apr 4 21:24:31 2014 @@ -73,6 +73,11 @@ the expanded directory is deleted first, any attempt to load a new class during undeploy will fail. (markt) </fix> + <fix> + <bug>56339</bug>: Avoid an infinite loop if an application calls + <code>session.invalidate()</code> from the session destroyed event for + that session. (markt) + </fix> </changelog> </subsection> <subsection name="Cluster"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org