Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 78483 invoked from network); 17 Jul 2009 11:15:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Jul 2009 11:15:25 -0000 Received: (qmail 31130 invoked by uid 500); 17 Jul 2009 11:16:30 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 31037 invoked by uid 500); 17 Jul 2009 11:16:30 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 31026 invoked by uid 99); 17 Jul 2009 11:16:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Jul 2009 11:16:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Jul 2009 11:16:26 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id EF1D52388896; Fri, 17 Jul 2009 11:16:05 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r795041 - in /tomcat/container/tc5.5.x: catalina/src/share/org/apache/catalina/session/StandardSession.java webapps/docs/changelog.xml Date: Fri, 17 Jul 2009 11:16:05 -0000 To: dev@tomcat.apache.org From: markt@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090717111605.EF1D52388896@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: markt Date: Fri Jul 17 11:16:05 2009 New Revision: 795041 URL: http://svn.apache.org/viewvc?rev=795041&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=40380 Correct synchronisation of expire(). Method should only run once. Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/StandardSession.java tomcat/container/tc5.5.x/webapps/docs/changelog.xml Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/StandardSession.java URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/StandardSession.java?rev=795041&r1=795040&r2=795041&view=diff ============================================================================== --- tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/StandardSession.java (original) +++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/StandardSession.java Fri Jul 17 11:16:05 2009 @@ -167,7 +167,7 @@ * certain IllegalStateException tests. NOTE: This value is not * included in the serialized version of this object. */ - protected transient boolean expiring = false; + protected transient volatile boolean expiring = false; /** @@ -224,7 +224,7 @@ /** * Flag indicating whether this session is valid or not. */ - protected boolean isValid = false; + protected volatile boolean isValid = false; /** @@ -666,15 +666,20 @@ */ public void expire(boolean notify) { - // Mark this session as "being expired" if needed - if (expiring) + // Check to see if expire is in progress or has previously been called + if (expiring || !isValid) return; synchronized (this) { + // Check again, now we are inside the sync so this code only runs once + // Double check locking - expiring and isValid need to be volatile + if (expiring || !isValid) + return; if (manager == null) return; + // Mark this session as "being expired" expiring = true; // Notify interested application event listeners Modified: tomcat/container/tc5.5.x/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/webapps/docs/changelog.xml?rev=795041&r1=795040&r2=795041&view=diff ============================================================================== --- tomcat/container/tc5.5.x/webapps/docs/changelog.xml (original) +++ tomcat/container/tc5.5.x/webapps/docs/changelog.xml Fri Jul 17 11:16:05 2009 @@ -126,6 +126,10 @@ (markt) + 40380: Fix potential synchronization issue in + StandardSession.expire(). (markt) + + 41407: JAAS Realm now works with CLIENT-CERT authentication. (markt) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org