tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amy Roh <amy...@apache.org>
Subject Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session StandardManager.java
Date Tue, 09 Dec 2003 23:57:57 GMT
remm@apache.org wrote:

> remm        2003/12/05 01:28:55
> 
>   Modified:    catalina/src/share/org/apache/catalina/session
>                         StandardManager.java
>   Log:
>   - isValid already expires sessions, so backgroundProcess shouldn't call
>     expire again.

isValid doesn't *always* expire session.

StandardSession.isValid() -

public boolean isValid() {

         if (this.expiring){
             return true;
         }

         if (!this.isValid ) {
***         return false;
         }

         if (maxInactiveInterval >= 0) {
             long timeNow = System.currentTimeMillis();
             int timeIdle = (int) ((timeNow - lastAccessedTime) / 1000L);
             if (timeIdle >= maxInactiveInterval) {
***             expire(true);
             }
         }

         return (this.isValid);
     }

If StandardSession.isValid is false, then we want to expire the session. 
  However, isValid() call doesn't get to expire(true) and just return 
false.  So removing session.expire() from 
StandardManager.processExpires() won't work all the time.  Am I missing 
something?

Thanks,
Amy

>   - Bug 25234, submitted by Paul Harvey.
>   
>   Revision  Changes    Path
>   1.16      +5 -11     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session/StandardManager.java
>   
>   Index: StandardManager.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session/StandardManager.java,v
>   retrieving revision 1.15
>   retrieving revision 1.16
>   diff -u -r1.15 -r1.16
>   --- StandardManager.java	29 Nov 2003 18:06:35 -0000	1.15
>   +++ StandardManager.java	5 Dec 2003 09:28:55 -0000	1.16
>   @@ -813,13 +813,7 @@
>            for (int i = 0; i < sessions.length; i++) {
>                StandardSession session = (StandardSession) sessions[i];
>                if (!session.isValid()) {
>   -                try {
>   -                    expiredSessions++;
>   -                    session.expire();
>   -                } catch (Throwable t) {
>   -                    log.error(sm.getString
>   -                              ("standardManager.expireException"), t);
>   -                }
>   +                expiredSessions++;
>                }
>            }
>            long timeEnd = System.currentTimeMillis();
>   
>   
>   
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message