Author: markt
Date: Fri Feb  1 12:00:28 2013
New Revision: 1441409

URL: http://svn.apache.org/viewvc?rev=1441409&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54507
Don't start expiring sessions until the web application is fully started. Stop 
expiring sessions as soon as the web application is stopped.

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java
    tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1441403

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1441409&r1=1441408&r2=1441409&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java Fri 
Feb  1 12:00:28 2013
@@ -5299,9 +5299,6 @@ public class StandardContext extends Con
                 if ((manager != null) && (manager instanceof Lifecycle)) {
                     ((Lifecycle) getManager()).start();
                 }
-    
-                // Start ContainerBackgroundProcessor thread
-                super.threadStart();
             } catch(Exception e) {
                 log.error("Error manager.start()", e);
                 ok = false;
@@ -5320,6 +5317,8 @@ public class StandardContext extends Con
                 loadOnStartup(findChildren());
             }
             
+            // Start ContainerBackgroundProcessor thread
+            super.threadStart();
         } finally {
             // Unbinding thread
             unbindThread(oldCCL);
@@ -5465,6 +5464,9 @@ public class StandardContext extends Con
             
             ClassLoader old = bindThread();
             try {
+                // Stop ContainerBackgroundProcessor thread
+                threadStop();
+
                 for (int i = 0; i < children.length; i++) {
                     children[i].stop();
                 }
@@ -5472,9 +5474,6 @@ public class StandardContext extends Con
                 // Stop our filters
                 filterStop();
             
-                // Stop ContainerBackgroundProcessor thread
-                threadStop();
-            
                 if (manager != null && manager instanceof Lifecycle &&
                         ((Lifecycle) manager).getState().isAvailable()) {
                     ((Lifecycle) manager).stop();

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=1441409&r1=1441408&r2=1441409&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Fri Feb  1 12:00:28 2013
@@ -94,6 +94,12 @@
         Include the exception in the log message if the parsing of the
         context.xml file fails. (markt/kkolinko)
       </fix>
+      <fix>
+        <bug>54507</bug>: Do not start the background thread that is used to
+        expiring sessions (amongst other things) until the web application is
+        fully started. Stop the background thread as soon as the web 
application
+        is stopped. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">



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

Reply via email to