tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r1353128 - in /tomcat/tc6.0.x/trunk: ./ java/org/apache/catalina/ha/session/ java/org/apache/catalina/session/ webapps/docs/
Date Sat, 23 Jun 2012 13:26:03 GMT
Author: kkolinko
Date: Sat Jun 23 13:26:02 2012
New Revision: 1353128

URL: http://svn.apache.org/viewvc?rev=1353128&view=rev
Log:
Note: technically, the actual patch differs from proposal (r1346675):
in Tomcat 7 the changes are in ManagerBase,
in Tomcat 6 the same code belongs to specific manager implementations.

Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53230
Change ManagerBase to throw TooManyActiveSessionsException instead of
IllegalStateException to allow for custom error page.

Added:
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/session/TooManyActiveSessionsException.java
      - copied unchanged from r1353117, tomcat/trunk/java/org/apache/catalina/session/TooManyActiveSessionsException.java
Modified:
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/DeltaManager.java
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/SimpleTcpReplicationManager.java
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/session/StandardManager.java
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1353128&r1=1353127&r2=1353128&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Sat Jun 23 13:26:02 2012
@@ -158,13 +158,6 @@ PATCHES PROPOSED TO BACKPORT:
   +1: markt, schultz, kkolinko
   -1:
 
-* Backport fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=53230
-  Change ManagerBase to throw TooManyActiveSessionsException instead of
-  IllegalStateException to allow for custom error page.
-  http://svn.apache.org/viewvc?view=revision&revision=1346675
-  +1: schultz, kkolinko, markt
-  -1:
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=52996
   In StandardThreadExecutor:
   Add the ability to configure a job queue size.

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/DeltaManager.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/DeltaManager.java?rev=1353128&r1=1353127&r2=1353128&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/DeltaManager.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/DeltaManager.java Sat Jun 23
13:26:02 2012
@@ -41,6 +41,7 @@ import org.apache.catalina.ha.CatalinaCl
 import org.apache.catalina.ha.ClusterMessage;
 import org.apache.catalina.ha.tcp.ReplicationValve;
 import org.apache.catalina.session.ManagerBase;
+import org.apache.catalina.session.TooManyActiveSessionsException;
 import org.apache.catalina.tribes.Member;
 import org.apache.catalina.tribes.io.ReplicationStream;
 import org.apache.catalina.util.LifecycleSupport;
@@ -586,7 +587,9 @@ public class DeltaManager extends Cluste
     public Session createSession(String sessionId, boolean distribute) {
         if ((maxActiveSessions >= 0) && (sessions.size() >= maxActiveSessions))
{
             rejectedSessions++;
-            throw new IllegalStateException(sm.getString("deltaManager.createSession.ise"));
+            throw new TooManyActiveSessionsException(
+                    sm.getString("deltaManager.createSession.ise"),
+                    maxActiveSessions);
         }
         DeltaSession session = (DeltaSession) super.createSession(sessionId) ;
         if (distribute) {

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/SimpleTcpReplicationManager.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/SimpleTcpReplicationManager.java?rev=1353128&r1=1353127&r2=1353128&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/SimpleTcpReplicationManager.java
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/SimpleTcpReplicationManager.java
Sat Jun 23 13:26:02 2012
@@ -26,6 +26,7 @@ import org.apache.catalina.ha.ClusterMes
 import org.apache.catalina.tribes.Member;
 import org.apache.catalina.realm.GenericPrincipal;
 import org.apache.catalina.session.StandardManager;
+import org.apache.catalina.session.TooManyActiveSessionsException;
 import org.apache.catalina.tribes.io.ReplicationStream;
 import java.io.ByteArrayInputStream;
 import org.apache.catalina.Loader;
@@ -203,9 +204,11 @@ public class SimpleTcpReplicationManager
 
         //inherited from the basic manager
         if ((getMaxActiveSessions() >= 0) &&
-           (sessions.size() >= getMaxActiveSessions()))
-            throw new IllegalStateException(sm.getString("standardManager.createSession.ise"));
-
+           (sessions.size() >= getMaxActiveSessions())) {
+            throw new TooManyActiveSessionsException(
+                    sm.getString("standardManager.createSession.ise"),
+                    getMaxActiveSessions());
+        }
 
         Session session = new ReplicatedSession(this);
 

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/session/StandardManager.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/session/StandardManager.java?rev=1353128&r1=1353127&r2=1353128&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/session/StandardManager.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/session/StandardManager.java Sat Jun 23
13:26:02 2012
@@ -284,8 +284,9 @@ public class StandardManager
         if ((maxActiveSessions >= 0) &&
             (sessions.size() >= maxActiveSessions)) {
             rejectedSessions++;
-            throw new IllegalStateException
-                (sm.getString("standardManager.createSession.ise"));
+            throw new TooManyActiveSessionsException(
+                    sm.getString("standardManager.createSession.ise"),
+                    maxActiveSessions);
         }
 
         return (super.createSession(sessionId));

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=1353128&r1=1353127&r2=1353128&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Sat Jun 23 13:26:02 2012
@@ -131,6 +131,12 @@
         <bug>53057</bug>: Add OpenSSL version number INFO log message when
         initializing. (schultz)
       </fix>
+      <update>
+        <bug>53230</bug>: Change session managers to throw
+        TooManyActiveSessionsException instead of IllegalStateException
+        when the maximum number of sessions has been exceeded and a new
+        session will not be created. (schultz/kkolinko)
+      </update>
       <fix>
         <bug>53267</bug>: Ensure that using the GC Daemon Protection feature
of
         the <code>JreMemoryLeakPreventionListener</code> does not trigger a



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


Mime
View raw message