[jboss-cvs] JBossAS SVN: r72955 - trunk/tomcat/src/main/org/jboss/web/tomcat/service/session.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu May 1 16:15:00 EDT 2008


Author: bstansberry at jboss.com
Date: 2008-05-01 16:14:59 -0400 (Thu, 01 May 2008)
New Revision: 72955

Modified:
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/ClusteredSession.java
Log:
[JBAS-4639] Replicate the timestamp at least every 60 secs

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/ClusteredSession.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/ClusteredSession.java	2008-05-01 20:11:58 UTC (rev 72954)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/ClusteredSession.java	2008-05-01 20:14:59 UTC (rev 72955)
@@ -162,7 +162,7 @@
     * session doesn't mark it as dirty. Drives the calculation
     * of maxUnreplicatedInterval.
     */
-   protected transient int maxUnreplicatedFactor = 80;
+   protected transient int maxUnreplicatedFactor = 25;
    
    /**
     * Maximum number of milliseconds this session
@@ -333,10 +333,18 @@
 
    /**
     * Gets the maximum percentage of the <code>maxInactiveInterval</code>
-    * beyond which a session should be replicated upon access even if it 
-    * isn't dirty.  Used to ensure that even a read-only session gets 
-    * replicated before it expires, so that it isn't removed from other
+    * beyond which the session timestamp should be replicated upon access even 
+    * if the session isn't dirty.  Used to ensure that even a read-only session 
+    * gets replicated before it expires, so that it isn't removed from other
     * nodes.
+    * <p>
+    * Default value is <code>25</code>.
+    * </p>
+    * <p>
+    * <strong>NOTE:</strong> If a timestamp hasn't been replicated in the last
+    * 60 seconds, the timestamp will be replicated, irregardless of this
+    * setting.  So, this setting really only serves to provide a lower setting.
+    * </p>
     * 
     * @return  an int between 1 and 100, or -1 if replicating on access is
     *          disabled
@@ -352,6 +360,14 @@
     * isn't dirty.  Used to ensure that even a read-only session gets 
     * replicated before it expires, so that it isn't removed from other
     * nodes.
+    * <p>
+    * Default value is <code>25</code>.
+    * </p>
+    * <p>
+    * <strong>NOTE:</strong> If a timestamp hasn't been replicated in the last
+    * 60 seconds, the timestamp will be replicated, irregardless of this
+    * setting.  So, this setting really only serves to provide a lower setting.
+    * </p>
     * 
     * @param maxUnreplicatedFactor  an int between 1 and 100, or -1 to
     *                               disable replicating on access
@@ -422,7 +438,8 @@
       else
       {
          // Ignoring casting would be (mII * 1000) * (mUF / 100)
-         maxUnreplicatedInterval = maxInactiveInterval * maxUnreplicatedFactor * 10;
+         int interval = maxInactiveInterval * maxUnreplicatedFactor * 10;
+         maxUnreplicatedInterval = Math.min(60000, interval);
       }
    }
    




More information about the jboss-cvs-commits mailing list