svn commit: r1209683 - /tomcat/trunk/.gitignore
Author: slaurent Date: Fri Dec 2 20:34:29 2011 New Revision: 1209683 URL: http://svn.apache.org/viewvc?rev=1209683&view=rev Log: synced svn ignores to git ignores Modified: tomcat/trunk/.gitignore Modified: tomcat/trunk/.gitignore URL: http://svn.apache.org/viewvc/tomcat/trunk/.gitignore?rev=1209683&r1=1209682&r2=1209683&view=diff == --- tomcat/trunk/.gitignore (original) +++ tomcat/trunk/.gitignore Fri Dec 2 20:34:29 2011 @@ -30,5 +30,7 @@ maven-ant-tasks-*.jar thumbs.db Thumbs.db bin/setenv.* +java/org/apache/catalina/startup/catalina.properties modules/jdbc-pool/bin modules/jdbc-pool/includes +webapps/docs/jdbc-pool.xml \ No newline at end of file - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1209686 [2/2] - in /tomcat/trunk: java/org/apache/catalina/core/ java/org/apache/catalina/loader/ java/org/apache/catalina/startup/ java/org/apache/naming/resources/ test/org/apache/catal
Propchange: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/resourceH.properties -- svn:eol-style = native Added: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc2/resourceJ.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc2/resourceJ.properties?rev=1209686&view=auto == --- tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc2/resourceJ.properties (added) +++ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc2/resourceJ.properties Fri Dec 2 20:49:50 2011 @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +resourceJInWebapp=true Propchange: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc2/resourceJ.properties -- svn:eol-style = native Modified: tomcat/trunk/webapps/docs/config/context.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/context.xml?rev=1209686&r1=1209685&r2=1209686&view=diff == --- tomcat/trunk/webapps/docs/config/context.xml (original) +++ tomcat/trunk/webapps/docs/config/context.xml Fri Dec 2 20:49:50 2011 @@ -539,6 +539,8 @@ docBase instead. These external locations will not be emptied if the context is un-deployed. +A more powerful feature (for development only) is +Virtual webapp. @@ -1251,6 +1253,82 @@ + +During development it may be more productive to avoid copying files (static +resources, JSPs, classes, jars...) and configure tomcat to use files from their +source locations. To do that, several customisations of the context configuration are +required: + + The VirtualDirContext implementation of + Resources + The VirtualWebappLoader implementation of + Loader + scanAllDirectories="true" on the JarScanner + +To illustrate this feature, here is an example of a standard maven webapp source tree: + +mywebapp/ + src/ + main/ + java/ + resources/ + webapp/ + WEB-INF/ + classes/ + target/ +classes/ + +To deploy such an application (assuming it also uses the log4j maven artefact), +the context configuration looks like: + ++ + + +Here is another example where the webapp serves pictures under /pictures and movies +under /movies and also depends on another maven project mylib that would normally +produce a jar to be packaged in WEB-INF/lib: + +mylib/ + src/ + main/ + java/ + resources/ + META-INF/ + resources/ + target/ + classes/ +mymovies/ +mypictures/ +mywebapp/ + src/ + main/ + java/ + resources/ + webapp/ + WEB-INF/ + classes/ + target/ +classes/ + +The configuration is: + ++ + + + svn commit: r1209731 - in /tomcat/trunk: ./ test/org/apache/catalina/loader/ test/webapp-3.0-virtual-library/ test/webapp-3.0-virtual-library/target/ test/webapp-3.0-virtual-library/target/classes/ te Author: slaurent Date: Fri Dec 2 22:16:33 2011 New Revision: 1209731 URL: http://svn.apache.org/viewvc?rev=1209731&view=rev Log: bug 51741: Eclipse WTP "Serve modules without publishing" broken with tc7, needs patch in tomcat https://issues.apache.org/bugzilla/show_bug.cgi?id=51741 fixed checkstyle problems + missing files in "target" directories because it was in gitignore Added: tomcat/trunk/test/webapp-3.0-virtual-library/ tomcat/trunk/test/webapp-3.0-virtual-library/target/ tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/ tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/ tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/C.tld - copied, changed from r1209694, tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/web.xml tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/resources/ tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/resources/rsrc/ tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/resources/rsrc/resourceE.properties - copied, changed from r1209694, tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/resourceF.properties tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/rsrc/ tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/rsrc/resourceC.properties - copied, changed from r1209694, tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/resourceF.properties tomcat/trunk/test/webapp-3.0-virtual-webapp/target/ tomcat/trunk/test/webapp-3.0-virtual-webapp/target/classes/ tomcat/trunk/test/webapp-3.0-virtual-webapp/target/classes/rsrc/ tomcat/trunk/test/webapp-3.0-virtual-webapp/target/classes/rsrc/resourceB.properties - copied, changed from r1209694, tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/resourceF.properties Removed: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/META-INF/context.xml Modified: tomcat/trunk/.gitignore tomcat/trunk/test/org/apache/catalina/loader/TestVirtualContext.java tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/web.xml tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetResource.jsp tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetResourcePaths.jsp tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/resourceF.properties tomcat/trunk/webapps/docs/config/context.xml tomcat/trunk/webapps/docs/config/resources.xml Modified: tomcat/trunk/.gitignore URL: http://svn.apache.org/viewvc/tomcat/trunk/.gitignore?rev=1209731&r1=1209730&r2=1209731&view=diff == --- tomcat/trunk/.gitignore (original) +++ tomcat/trunk/.gitignore Fri Dec 2 22:16:33 2011 @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # - -target output logs work Modified: tomcat/trunk/test/org/apache/catalina/loader/TestVirtualContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/loader/TestVirtualContext.java?rev=1209731&r1=1209730&r2=1209731&view=diff == --- tomcat/trunk/test/org/apache/catalina/loader/TestVirtualContext.java (original) +++ tomcat/trunk/test/org/apache/catalina/loader/TestVirtualContext.java Fri Dec 2 22:16:33 2011 @@ -25,10 +25,10 @@ import java.io.InputStream; import java.util.Arrays; import java.util.HashSet; -import junit.framework.Assert; - import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; + +import org.junit.Assert; import org.junit.Test; import org.apache.catalina.core.JreMemoryLeakPreventionListener; Copied: tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/C.tld (from r1209694, tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/web.xml) URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/C.tld?p2=tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/C.tld&p1=tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/web.xml&r1=1209694&r2=1209731&rev=1209731&view=diff == --- tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/web.xml (original) +++ tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/C.tld Fri Dec 2 22:16:33 2011 @@ -1,4 +1,4 @@ - + -http://java.sun.com/xml/ns/javaee"; - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; - xsi:schemaLocation="http://java.sun.co
svn commit: r1210012 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/core/ java/org/apache/catalina/loader/ java/org/apache/catalina/startup/ java/org/apache/naming/resources/ test/org/apache/
Author: slaurent Date: Sat Dec 3 21:37:49 2011 New Revision: 1210012 URL: http://svn.apache.org/viewvc?rev=1210012&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51741 bug 51741: Eclipse WTP "Serve modules without publishing" broken with tc7, needs patch in tomcat https://issues.apache.org/bugzilla/show_bug.cgi?id=51741 merged revisions 1209685:1209731 from trunk to tc7 Added: tomcat/tc7.0.x/trunk/test/org/apache/catalina/loader/EchoTag.java - copied unchanged from r1209731, tomcat/trunk/test/org/apache/catalina/loader/EchoTag.java tomcat/tc7.0.x/trunk/test/org/apache/catalina/loader/MyAnnotatedServlet.java - copied unchanged from r1209731, tomcat/trunk/test/org/apache/catalina/loader/MyAnnotatedServlet.java tomcat/tc7.0.x/trunk/test/org/apache/catalina/loader/TestVirtualContext.java - copied unchanged from r1209731, tomcat/trunk/test/org/apache/catalina/loader/TestVirtualContext.java tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-library/ - copied from r1209731, tomcat/trunk/test/webapp-3.0-virtual-library/ tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-library/target/ - copied from r1209731, tomcat/trunk/test/webapp-3.0-virtual-library/target/ tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-library/target/classes/ - copied from r1209731, tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/ tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/ - copied from r1209731, tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/ tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/C.tld - copied unchanged from r1209731, tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/C.tld tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/resources/ - copied from r1209731, tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/resources/ tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/resources/rsrc/ - copied from r1209731, tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/resources/rsrc/ tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/resources/rsrc/resourceE.properties - copied unchanged from r1209731, tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/META-INF/resources/rsrc/resourceE.properties tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-library/target/classes/rsrc/ - copied from r1209731, tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/rsrc/ tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-library/target/classes/rsrc/resourceC.properties - copied unchanged from r1209731, tomcat/trunk/test/webapp-3.0-virtual-library/target/classes/rsrc/resourceC.properties tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/ - copied from r1209731, tomcat/trunk/test/webapp-3.0-virtual-webapp/ tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/ - copied from r1209731, tomcat/trunk/test/webapp-3.0-virtual-webapp/src/ tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/ - copied from r1209731, tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/ tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/ - copied from r1209731, tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/ tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/META-INF/ - copied from r1209731, tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/META-INF/ tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/META-INF/B.tld - copied unchanged from r1209731, tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/META-INF/B.tld tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/rsrc/ - copied from r1209731, tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/rsrc/ tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/rsrc/resourceD.properties - copied unchanged from r1209731, tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/rsrc/resourceD.properties tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/misc/ - copied from r1209731, tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/misc/ tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/misc/resourceI.properties - copied unchanged from r1209731, tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/misc/resourceI.properties tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/ - copied from r1209731, tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/ tomcat/tc7.0.x/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/META-INF/ - copied from r1209731, tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/META-INF/ tomcat/tc7.0.x/trunk/test/weba
svn commit: r1163802 - in /tomcat: tc7.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoader.java trunk/java/org/apache/catalina/loader/WebappClassLoader.java
Author: slaurent Date: Wed Aug 31 20:35:22 2011 New Revision: 1163802 URL: http://svn.apache.org/viewvc?rev=1163802&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51741 bug 51741: Eclipse WTP "Serve modules without publishing" broken with tc7, needs patch in tomcat Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoader.java tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoader.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoader.java?rev=1163802&r1=1163801&r2=1163802&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoader.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoader.java Wed Aug 31 20:35:22 2011 @@ -2898,11 +2898,22 @@ public class WebappClassLoader // Note : Not getting an exception here means the resource was // found -entry = findResourceInternal(files[i], path); ResourceAttributes attributes = (ResourceAttributes) resources.getAttributes(fullPath); contentLength = (int) attributes.getContentLength(); +String canonicalPath = attributes.getCanonicalPath(); +if (canonicalPath != null) { +// we create the ResourceEntry based on the information returned +// by the DirContext rather than just using the path to the +// repository. This allows to have smart DirContext implementations +// that "virtualize" the docbase (e.g. Eclipse WTP) +entry = findResourceInternal(new File(canonicalPath), ""); +} else { +// probably a resource not in the filesystem (e.g. in a +// packaged war) +entry = findResourceInternal(files[i], path); +} entry.lastModified = attributes.getLastModified(); if (resource != null) { Modified: tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java?rev=1163802&r1=1163801&r2=1163802&view=diff == --- tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java (original) +++ tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java Wed Aug 31 20:35:22 2011 @@ -2898,11 +2898,22 @@ public class WebappClassLoader // Note : Not getting an exception here means the resource was // found -entry = findResourceInternal(files[i], path); ResourceAttributes attributes = (ResourceAttributes) resources.getAttributes(fullPath); contentLength = (int) attributes.getContentLength(); +String canonicalPath = attributes.getCanonicalPath(); +if (canonicalPath != null) { +// we create the ResourceEntry based on the information returned +// by the DirContext rather than just using the path to the +// repository. This allows to have smart DirContext implementations +// that "virtualize" the docbase (e.g. Eclipse WTP) +entry = findResourceInternal(new File(canonicalPath), ""); +} else { +// probably a resource not in the filesystem (e.g. in a +// packaged war) +entry = findResourceInternal(files[i], path); +} entry.lastModified = attributes.getLastModified(); if (resource != null) { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1163804 - /tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
Author: slaurent Date: Wed Aug 31 20:37:38 2011 New Revision: 1163804 URL: http://svn.apache.org/viewvc?rev=1163804&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51741 bug 51741: Eclipse WTP "Serve modules without publishing" broken with tc7, needs patch in tomcat added section for 7.0.22 and moved log of bug 51744 to 7.0.22 since it has been fixed after 7.0.21 was tagged. Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml 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=1163804&r1=1163803&r2=1163804&view=diff == --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Wed Aug 31 20:37:38 2011 @@ -53,6 +53,41 @@ They eventually become mixed with the numbered issues. (I.e., numbered issues to not "pop up" wrt. others). --> + + + + +51744: Prevent application code from closing the associated +JNDI context while the application is running. (markt) + + +51741: Fixes a problem with Eclipse WTP "Serve modules without +publishing" feature where applications failed to access resources when using + getResource() on the classloader. (slaurent) + + + + + + + + + + + + + + + + + + + + + + + + @@ -107,10 +142,6 @@ 51739: When using a landing page with FORM authentication ensure that the request has a valid HTTP method. (markt) - -51744: Prevent application code from closing the associated -JNDI context while the application is running. (markt) - - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1163807 - in /tomcat: tc7.0.x/trunk/ trunk/
Author: slaurent Date: Wed Aug 31 20:38:53 2011 New Revision: 1163807 URL: http://svn.apache.org/viewvc?rev=1163807&view=rev Log: bug 51741: Eclipse WTP "Serve modules without publishing" broken with tc7, needs patch in tomcat https://issues.apache.org/bugzilla/show_bug.cgi?id=51741 Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/trunk/ (props changed) Propchange: tomcat/tc7.0.x/trunk/ -- subclipse:tags = 1162976,TOMCAT_7_0_21,/tomcat/tc7.0.x/tags/TOMCAT_7_0_21,tag Propchange: tomcat/trunk/ -- --- subclipse:tags (added) +++ subclipse:tags Wed Aug 31 20:38:53 2011 @@ -0,0 +1,2 @@ +932358,branches,/tomcat/tc7.0.x/branches,branch +1162976,TOMCAT_7_0_21,/tomcat/tc7.0.x/tags/TOMCAT_7_0_21,tag - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1164222 - /tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
Author: slaurent Date: Thu Sep 1 19:27:54 2011 New Revision: 1164222 URL: http://svn.apache.org/viewvc?rev=1164222&view=rev Log: removed unused sections Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml 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=1164222&r1=1164221&r2=1164222&view=diff == --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Thu Sep 1 19:27:54 2011 @@ -67,22 +67,6 @@ - - - - - - - - - - - - - - - - - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1164235 - /tomcat/tc7.0.x/trunk/
Author: slaurent Date: Thu Sep 1 19:47:13 2011 New Revision: 1164235 URL: http://svn.apache.org/viewvc?rev=1164235&view=rev Log: adding subclipse:tags for tc7 tags up to 7.0.21 to allow subclipse to display tags in history view. Modified: tomcat/tc7.0.x/trunk/ (props changed) Propchange: tomcat/tc7.0.x/trunk/ -- --- subclipse:tags (added) +++ subclipse:tags Thu Sep 1 19:47:13 2011 @@ -0,0 +1,26 @@ +933020,TOMCAT_7_0_0_RC1,/tomcat/tc7.0.x/tags/TOMCAT_7_0_0_RC1,tag +945257,TOMCAT_7_0_0_RC2,/tomcat/tc7.0.x/tags/TOMCAT_7_0_0_RC2,tag +947494,TOMCAT_7_0_0_RC3,/tomcat/tc7.0.x/tags/TOMCAT_7_0_0_RC3,tag +952212,TOMCAT_7_0_0_RC4,/tomcat/tc7.0.x/tags/TOMCAT_7_0_0_RC4,tag +954232,TOMCAT_7_0_0,/tomcat/tc7.0.x/tags/TOMCAT_7_0_0,tag +981255,TOMCAT_7_0_1,/tomcat/tc7.0.x/tags/TOMCAT_7_0_1,tag +982035,TOMCAT_7_0_2,/tomcat/tc7.0.x/tags/TOMCAT_7_0_2,tag +1003912,TOMCAT_7_0_3,/tomcat/tc7.0.x/tags/TOMCAT_7_0_3,tag +1022637,TOMCAT_7_0_4,/tomcat/tc7.0.x/tags/TOMCAT_7_0_4,tag +1038717,TOMCAT_7_0_5,/tomcat/tc7.0.x/tags/TOMCAT_7_0_5,tag +1057288,TOMCAT_7_0_6,/tomcat/tc7.0.x/tags/TOMCAT_7_0_6,tag +1066773,TOMCAT_7_0_7,/tomcat/tc7.0.x/tags/TOMCAT_7_0_7,tag +1067169,TOMCAT_7_0_8,/tomcat/tc7.0.x/tags/TOMCAT_7_0_8,tag +1075337,TOMCAT_7_0_9,/tomcat/tc7.0.x/tags/TOMCAT_7_0_9,tag +1078282,TOMCAT_7_0_10,/tomcat/tc7.0.x/tags/TOMCAT_7_0_10,tag +1080182,TOMCAT_7_0_11,/tomcat/tc7.0.x/tags/TOMCAT_7_0_11,tag +1087797,TOMCAT_7_0_12,/tomcat/tc7.0.x/tags/TOMCAT_7_0_12,tag +1101230,TOMCAT_7_0_14,/tomcat/tc7.0.x/tags/TOMCAT_7_0_14,tag +1101232,TOMCAT_7_0_13,/tomcat/tc7.0.x/tags/TOMCAT_7_0_13,tag +1131469,TOMCAT_7_0_15,/tomcat/tc7.0.x/tags/TOMCAT_7_0_15,tag +1134562,TOMCAT_7_0_16,/tomcat/tc7.0.x/tags/TOMCAT_7_0_16,tag +1142314,TOMCAT_7_0_17,/tomcat/tc7.0.x/tags/TOMCAT_7_0_17,tag +1143610,TOMCAT_7_0_18,/tomcat/tc7.0.x/tags/TOMCAT_7_0_18,tag +1146504,TOMCAT_7_0_19,/tomcat/tc7.0.x/tags/TOMCAT_7_0_19,tag +1155255,TOMCAT_7_0_20,/tomcat/tc7.0.x/tags/TOMCAT_7_0_20,tag +1162976,TOMCAT_7_0_21,/tomcat/tc7.0.x/tags/TOMCAT_7_0_21,tag - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1174353 - in /tomcat/trunk: java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java java/org/apache/catalina/core/LocalStrings.properties webapps/docs/config/listeners.xml
Author: slaurent Date: Thu Sep 22 20:01:52 2011 New Revision: 1174353 URL: http://svn.apache.org/viewvc?rev=1174353&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51862 bug 51862: JreMemoryLeakPreventionListener enhancement to load configurable classes https://issues.apache.org/bugzilla/show_bug.cgi?id=51862 Modified: tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties tomcat/trunk/webapps/docs/config/listeners.xml Modified: tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java?rev=1174353&r1=1174352&r2=1174353&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java Thu Sep 22 20:01:52 2011 @@ -24,6 +24,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.sql.DriverManager; +import java.util.StringTokenizer; import javax.imageio.ImageIO; import javax.xml.parsers.DocumentBuilderFactory; @@ -202,7 +203,21 @@ public class JreMemoryLeakPreventionList public void setDriverManagerProtection(boolean driverManagerProtection) { this.driverManagerProtection = driverManagerProtection; } - + +/** + * List of comma-separated fully qualified class names to load and initialize during + * the startup of this Listener. This allows to pre-load classes that are known to + * provoke classloader leaks if they are loaded during a request processing. + */ +private String classesToInitialize = null; +public String getClassesToInitialize() { +return classesToInitialize; +} +public void setClassesToInitialize(String classesToInitialize) { +this.classesToInitialize = classesToInitialize; +} + + @Override public void lifecycleEvent(LifecycleEvent event) { // Initialise these classes when Tomcat starts @@ -419,6 +434,22 @@ public class JreMemoryLeakPreventionList } } } + +if (classesToInitialize != null) { +StringTokenizer strTok = +new StringTokenizer(classesToInitialize, ", \r\n\t"); +while (strTok.hasMoreTokens()) { +String classNameToLoad = strTok.nextToken(); +try { +Class.forName(classNameToLoad); +} catch (ClassNotFoundException e) { +log.error( + sm.getString("jreLeakListener.classToInitializeFail", +classNameToLoad), e); +// continue with next class to load +} +} +} } finally { Thread.currentThread().setContextClassLoader(loader); Modified: tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties?rev=1174353&r1=1174352&r2=1174353&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties Thu Sep 22 20:01:52 2011 @@ -83,6 +83,7 @@ jreLeakListener.jarUrlConnCacheFail=Fail jreLeakListener.xmlParseFail=Error whilst attempting to prevent memory leaks during XML parsing jreLeakListener.authPolicyFail=Error whilst attempting to prevent memory leak in javax.security.auth.Policy class jreLeakListener.ldapPoolManagerFail=Failed to trigger creation of the com.sun.jndi.ldap.LdapPoolManager class during Tomcat start to prevent possible memory leaks. This is expected on non-Sun JVMs. +jreLeakListener.classToInitializeFail=Failed to load class {0} during Tomcat start to prevent possible memory leaks. naming.wsdlFailed=Failed to find wsdl file: {0} naming.bindFailed=Failed to bind object: {0} naming.jmxRegistrationFailed=Failed to register in JMX: {0} Modified: tomcat/trunk/webapps/docs/config/listeners.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/listeners.xml?rev=1174353&r1=1174352&r2=1174353&view=diff == --- tomcat/trunk/webapps/docs/config/listeners.xml (original) +++ tomcat/trunk/webapps/docs/config/listeners.xml Thu Sep 22 20:01:52 2011 @@ -181,6 +1
svn commit: r1174359 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java java/org/apache/catalina/core/LocalStrings.properties webapps/docs/config/listene
Author: slaurent Date: Thu Sep 22 20:06:58 2011 New Revision: 1174359 URL: http://svn.apache.org/viewvc?rev=1174359&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51862 bug 51862: JreMemoryLeakPreventionListener enhancement to load configurable classes https://issues.apache.org/bugzilla/show_bug.cgi?id=51862 Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/LocalStrings.properties tomcat/tc7.0.x/trunk/webapps/docs/config/listeners.xml Propchange: tomcat/tc7.0.x/trunk/ -- --- svn:mergeinfo (original) +++ svn:mergeinfo Thu Sep 22 20:06:58 2011 @@ -1 +1 @@ -/tomcat/trunk:1156171,1156276,1156304,1156530,1156602,1157015,1157018,1157151,1157198,1157204,1157810,1157832,1157834,1157847,1157908,1157939,1158155,1158160,1158176,1158195,1158198-1158199,1158227,1158331,1158334-1158335,1158426,1160347,1160592,1160611,1160619,1160626,1160639,1160652,1160720-1160721,1160772,1160774,1160776,1161303,1161310,1161322,1161339,1161486,1161540,1161549,1161584,1162082,1162149,1162169,1162721,1162769,1162836,1162932,1163630,1164419,1164438,1164469,1164480,1164567,1165234,1165247-1165248,1165253,1165273,1165282,1165309,1165331,1165338,1165347,1165360-1165361,1165367-1165368,1165602,1165608,1165677,1165693,1165721,1165723,1165728,1165730,1165738,1165746,1165765,1165777,1165918,1165921,1166077,1166150-1166151,1166290,1166366,1166620,1166686,1166752,1166757,1167368,1167394,1169447,1170647,1171692,1172233-1172234,1172236,1172269,1172278,1172282,1172610,1172664,1172689,1172711,1173020-1173021,1173082,1173088,1173090,1173096,1173241,1173256,1173288,1173461 ,1173614,1173630,1173659,1173722,1174061,1174239 +/tomcat/trunk:1156171,1156276,1156304,1156530,1156602,1157015,1157018,1157151,1157198,1157204,1157810,1157832,1157834,1157847,1157908,1157939,1158155,1158160,1158176,1158195,1158198-1158199,1158227,1158331,1158334-1158335,1158426,1160347,1160592,1160611,1160619,1160626,1160639,1160652,1160720-1160721,1160772,1160774,1160776,1161303,1161310,1161322,1161339,1161486,1161540,1161549,1161584,1162082,1162149,1162169,1162721,1162769,1162836,1162932,1163630,1164419,1164438,1164469,1164480,1164567,1165234,1165247-1165248,1165253,1165273,1165282,1165309,1165331,1165338,1165347,1165360-1165361,1165367-1165368,1165602,1165608,1165677,1165693,1165721,1165723,1165728,1165730,1165738,1165746,1165765,1165777,1165918,1165921,1166077,1166150-1166151,1166290,1166366,1166620,1166686,1166752,1166757,1167368,1167394,1169447,1170647,1171692,1172233-1172234,1172236,1172269,1172278,1172282,1172610,1172664,1172689,1172711,1173020-1173021,1173082,1173088,1173090,1173096,1173241,1173256,1173288,1173461 ,1173614,1173630,1173659,1173722,1174061,1174239,1174353 Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java?rev=1174359&r1=1174358&r2=1174359&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java Thu Sep 22 20:06:58 2011 @@ -24,6 +24,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.sql.DriverManager; +import java.util.StringTokenizer; import javax.imageio.ImageIO; import javax.xml.parsers.DocumentBuilderFactory; @@ -202,7 +203,21 @@ public class JreMemoryLeakPreventionList public void setDriverManagerProtection(boolean driverManagerProtection) { this.driverManagerProtection = driverManagerProtection; } - + +/** + * List of comma-separated fully qualified class names to load and initialize during + * the startup of this Listener. This allows to pre-load classes that are known to + * provoke classloader leaks if they are loaded during a request processing. + */ +private String classesToInitialize = null; +public String getClassesToInitialize() { +return classesToInitialize; +} +public void setClassesToInitialize(String classesToInitialize) { +this.classesToInitialize = classesToInitialize; +} + + @Override public void lifecycleEvent(LifecycleEvent event) { // Initialise these classes when Tomcat starts @@ -419,6 +434,22 @@ public class JreMemoryLeakPreventionList } } } + +if (classesToInitialize != null) { +StringTokenizer strTok = +new StringTokenizer(classesToIniti
svn commit: r1174372 - /tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
Author: slaurent Date: Thu Sep 22 20:20:26 2011 New Revision: 1174372 URL: http://svn.apache.org/viewvc?rev=1174372&view=rev Log: bug 51862: JreMemoryLeakPreventionListener enhancement to load configurable classes https://issues.apache.org/bugzilla/show_bug.cgi?id=51862 Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml 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=1174372&r1=1174371&r2=1174372&view=diff == --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Thu Sep 22 20:20:26 2011 @@ -117,6 +117,11 @@ Add Java 7 sunec.jar and zipfs.jar to the list of JARs to skip when scanning for TLDs and web fragments. (rjung) + +51862: Added a classesToInitialize attribute to +JreMemoryLeakPreventionListener to allow pre-loading of configurable +classes to avoid some classloader leaks. (slaurent) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1174376 - /tomcat/tc6.0.x/trunk/STATUS.txt
Author: slaurent Date: Thu Sep 22 20:33:43 2011 New Revision: 1174376 URL: http://svn.apache.org/viewvc?rev=1174376&view=rev Log: bug 51862: JreMemoryLeakPreventionListener enhancement to load configurable classes https://issues.apache.org/bugzilla/show_bug.cgi?id=51862 Modified: tomcat/tc6.0.x/trunk/STATUS.txt Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1174376&r1=1174375&r2=1174376&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Thu Sep 22 20:33:43 2011 @@ -88,6 +88,12 @@ PATCHES PROPOSED TO BACKPORT: +1: kkolinko, markt -1: +* bug 51862: JreMemoryLeakPreventionListener enhancement to load configurable classes + https://issues.apache.org/bugzilla/show_bug.cgi?id=51862 + http://svn.apache.org/viewvc?rev=1174359&view=rev + +1: slaurent + -1: + PATCHES/ISSUES THAT ARE STALLED * Backport JSP unloading patch (BZ48358). - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1041613 - in /tomcat/site/trunk: docs/whoweare.html xdocs/whoweare.xml
Author: slaurent Date: Thu Dec 2 22:14:23 2010 New Revision: 1041613 URL: http://svn.apache.org/viewvc?rev=1041613&view=rev Log: added slaurent as committer Modified: tomcat/site/trunk/docs/whoweare.html tomcat/site/trunk/xdocs/whoweare.xml Modified: tomcat/site/trunk/docs/whoweare.html URL: http://svn.apache.org/viewvc/tomcat/site/trunk/docs/whoweare.html?rev=1041613&r1=1041612&r2=1041613&view=diff == --- tomcat/site/trunk/docs/whoweare.html (original) +++ tomcat/site/trunk/docs/whoweare.html Thu Dec 2 22:14:23 2010 @@ -322,6 +322,11 @@ A complete list of all the Apache Commit +Sylvain Laurent (slaurent at apache.org) + + + + Remy Maucherat (remm at apache.org) Modified: tomcat/site/trunk/xdocs/whoweare.xml URL: http://svn.apache.org/viewvc/tomcat/site/trunk/xdocs/whoweare.xml?rev=1041613&r1=1041612&r2=1041613&view=diff == --- tomcat/site/trunk/xdocs/whoweare.xml (original) +++ tomcat/site/trunk/xdocs/whoweare.xml Thu Dec 2 22:14:23 2010 @@ -84,6 +84,9 @@ A complete list of all the Apache Commit Konstantin Kolinko (kkolinko at apache.org) +Sylvain Laurent (slaurent at apache.org) + + Remy Maucherat (remm at apache.org) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1042022 - in /tomcat: tc6.0.x/trunk/STATUS.txt trunk/java/org/apache/catalina/session/StandardManager.java trunk/webapps/docs/changelog.xml
Author: slaurent Date: Fri Dec 3 22:00:58 2010 New Revision: 1042022 URL: http://svn.apache.org/viewvc?rev=1042022&view=rev Log: bug 48973 (enhancement): Don't create SESSIONS.ser when no session exists https://issues.apache.org/bugzilla/show_bug.cgi?id=48973 Modified: tomcat/tc6.0.x/trunk/STATUS.txt tomcat/trunk/java/org/apache/catalina/session/StandardManager.java tomcat/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=1042022&r1=1042021&r2=1042022&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Fri Dec 3 22:00:58 2010 @@ -207,3 +207,10 @@ PATCHES PROPOSED TO BACKPORT: http://people.apache.org/~markt/patches/2010-12-02-bug50201-tc6.patch +1: markt -1: + +* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48973 + Avoid creating file SESSIONS.ser if there's no session. + The patch provided by Marc Guillemot works for tc 6 & 7 + +1: slaurent + -1: + \ No newline at end of file Modified: tomcat/trunk/java/org/apache/catalina/session/StandardManager.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/StandardManager.java?rev=1042022&r1=1042021&r2=1042022&view=diff == --- tomcat/trunk/java/org/apache/catalina/session/StandardManager.java (original) +++ tomcat/trunk/java/org/apache/catalina/session/StandardManager.java Fri Dec 3 22:00:58 2010 @@ -366,6 +366,11 @@ public class StandardManager extends Man if (log.isDebugEnabled()) log.debug("Unloading persisted sessions"); + +if (sessions.isEmpty()) { +log.debug("No persisted sessions to unload"); +return; // nothing to do +} // Open an output stream to the specified pathname, if any File file = file(); Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1042022&r1=1042021&r2=1042022&view=diff == --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Fri Dec 3 22:00:58 2010 @@ -33,6 +33,7 @@ Tim Whittington Mladen Turk Christopher Schultz +Sylvain Laurent Changelog @@ -41,6 +42,11 @@ + +48973: Avoid creating a SESSIONS.ser file when stopping an +application if there's no session. Patch provided by Marc Guillemot. +(slaurent) + 48692: Provide option to parse application/x-www-form-urlencoded PUT requests. (schultz) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1042029 - in /tomcat: tc6.0.x/trunk/STATUS.txt trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java trunk/webapps/docs/changelog.xml trunk/webapps/docs/config/listener
Author: slaurent Date: Fri Dec 3 22:19:11 2010 New Revision: 1042029 URL: http://svn.apache.org/viewvc?rev=1042029&view=rev Log: bug 50282 : Load javax.security.auth.login.Configuration with JreMemoryLeakPreventionListener to avoid memory leak when stopping a webapp that would use JAAS. Modified: tomcat/tc6.0.x/trunk/STATUS.txt tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java tomcat/trunk/webapps/docs/changelog.xml tomcat/trunk/webapps/docs/config/listeners.xml Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1042029&r1=1042028&r2=1042029&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Fri Dec 3 22:19:11 2010 @@ -213,4 +213,10 @@ PATCHES PROPOSED TO BACKPORT: The patch provided by Marc Guillemot works for tc 6 & 7 +1: slaurent -1: + +* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50282 + Improve JreMemoryLeakPreventionListener to load + javax.security.auth.login.Configuration to avoid redeployment leak. + +1: slaurent + -1: \ No newline at end of file Modified: tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java?rev=1042029&r1=1042028&r2=1042029&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java Fri Dec 3 22:19:11 2010 @@ -107,7 +107,21 @@ public class JreMemoryLeakPreventionList this.securityPolicyProtection = securityPolicyProtection; } -/** + /** + * Protect against the memory leak caused when the first call to + * javax.security.auth.login.Configuration is triggered by a web + * application. This first call populate a static variable with a reference + * to the context class loader. Defaults to true. + */ + private boolean securityLoginConfigurationProtection = true; + public boolean isSecurityLoginConfigurationProtection() { + return securityLoginConfigurationProtection; + } + public void setSecurityLoginConfigurationProtection(boolean securityLoginConfigurationProtection) { + this.securityLoginConfigurationProtection = securityLoginConfigurationProtection; + } + + /** * Protect against the memory leak, when the initialization of the * Java Cryptography Architecture is triggered by initializing * a MessageDigest during web application deployment. @@ -274,6 +288,19 @@ public class JreMemoryLeakPreventionList } } + +/* + * Initializing javax.security.auth.login.Configuration retains a static reference to the context + * class loader. + */ +if (securityLoginConfigurationProtection) { +try { + Class.forName("javax.security.auth.login.Configuration", true, ClassLoader.getSystemClassLoader()); +} catch(ClassNotFoundException e) { +// Ignore +} +} + /* * Creating a MessageDigest during web application startup * initializes the Java Cryptography Architecture. Under certain Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1042029&r1=1042028&r2=1042029&view=diff == --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Fri Dec 3 22:19:11 2010 @@ -43,6 +43,12 @@ +50282: Load javax.security.auth.login.Configuration +with JreMemoryLeakPreventionListener to avoid memory leak +when stopping a webapp that would use JAAS. +(slaurent) + + 48973: Avoid creating a SESSIONS.ser file when stopping an application if there's no session. Patch provided by Marc Guillemot. (slaurent) Modified: tomcat/trunk/webapps/docs/config/listeners.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/listeners.xml?rev=1042029&r1=1042028&r2=1042029&view=diff == --- tomcat/trunk/webapps/docs/config/listeners.xml (original) +++ tomcat/trunk/webapps/docs/config/listeners.xml Fri Dec 3 22:19:11 2010 @@ -270,6 +270,16 @@ service:jmx:rm
svn commit: r1042447 - /tomcat/trunk/webapps/docs/config/listeners.xml
Author: slaurent Date: Sun Dec 5 21:06:25 2010 New Revision: 1042447 URL: http://svn.apache.org/viewvc?rev=1042447&view=rev Log: bug 50282 / fixed some typos in documentation Modified: tomcat/trunk/webapps/docs/config/listeners.xml Modified: tomcat/trunk/webapps/docs/config/listeners.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/listeners.xml?rev=1042447&r1=1042446&r2=1042447&view=diff == --- tomcat/trunk/webapps/docs/config/listeners.xml (original) +++ tomcat/trunk/webapps/docs/config/listeners.xml Sun Dec 5 21:06:25 2010 @@ -273,11 +273,11 @@ service:jmx:rmi://<hostname>:10002 Enables protection so that usage of the javax.security.auth.login.Configuration class by a web -application does not in a memory leak. The first access of this class will -trigger the initializer that will retain a static reference to the context -class loader. The protection loads the class with the system classloader -to ensure that the static initializer is not triggered by web application. -Defaults to true. +application does not provoke a memory leak. The first access of this +class will trigger the initializer that will retain a static reference +to the context class loader. The protection loads the class with the +system class loader to ensure that the static initializer is not +triggered by web application. Defaults to true. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1042448 - /tomcat/trunk/webapps/docs/changelog.xml
Author: slaurent Date: Sun Dec 5 21:07:49 2010 New Revision: 1042448 URL: http://svn.apache.org/viewvc?rev=1042448&view=rev Log: sort entries by ascending BZ number Modified: tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1042448&r1=1042447&r2=1042448&view=diff == --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Sun Dec 5 21:07:49 2010 @@ -42,31 +42,25 @@ - -50282: Load javax.security.auth.login.Configuration -with JreMemoryLeakPreventionListener to avoid memory leak -when stopping a webapp that would use JAAS. - (slaurent) - - -48973: Avoid creating a SESSIONS.ser file when stopping an -application if there's no session. Patch provided by Marc Guillemot. -(slaurent) - - -48692: Provide option to parse -application/x-www-form-urlencoded PUT requests. (schultz) - 8705: org.apache.catalina.SessionListener now extends java.util.EventListener. (markt) + +48692: Provide option to parse +application/x-www-form-urlencoded PUT requests. (schultz) + 48837: Extend thread local memory leak detection to include classes loaded by subordinate class loaders to the web application's class loader such as the Jasper class loader. Based on a patch by Sylvain Laurent. (markt) + +48973: Avoid creating a SESSIONS.ser file when stopping an +application if there's no session. Patch provided by Marc Guillemot. +(slaurent) + 49650: Remove unnecessary entries package.access property defined in catalina.properties. Patch provided by Owen Farrell. (markt) @@ -81,6 +75,12 @@ options to control the SecureRandom instances used to generate session IDs. (markt) + +50282: Load javax.security.auth.login.Configuration +with JreMemoryLeakPreventionListener to avoid memory leak +when stopping a web application that would use JAAS. +(slaurent) + 50351: Fix the regression that broke BeanFactory resources caused by the previous fix for 50159. (markt) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1042452 - /tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
Author: slaurent Date: Sun Dec 5 21:26:22 2010 New Revision: 1042452 URL: http://svn.apache.org/viewvc?rev=1042452&view=rev Log: bug 50282 / fixed line length Modified: tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java Modified: tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java?rev=1042452&r1=1042451&r2=1042452&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java Sun Dec 5 21:26:22 2010 @@ -107,19 +107,20 @@ public class JreMemoryLeakPreventionList this.securityPolicyProtection = securityPolicyProtection; } - /** - * Protect against the memory leak caused when the first call to - * javax.security.auth.login.Configuration is triggered by a web - * application. This first call populate a static variable with a reference - * to the context class loader. Defaults to true. - */ - private boolean securityLoginConfigurationProtection = true; - public boolean isSecurityLoginConfigurationProtection() { - return securityLoginConfigurationProtection; - } - public void setSecurityLoginConfigurationProtection(boolean securityLoginConfigurationProtection) { - this.securityLoginConfigurationProtection = securityLoginConfigurationProtection; - } +/** + * Protects against the memory leak caused when the first call to + * javax.security.auth.login.Configuration is triggered by a + * web application. This first call populate a static variable with a + * reference to the context class loader. Defaults to true. + */ +private boolean securityLoginConfigurationProtection = true; +public boolean isSecurityLoginConfigurationProtection() { +return securityLoginConfigurationProtection; +} +public void setSecurityLoginConfigurationProtection( +boolean securityLoginConfigurationProtection) { +this.securityLoginConfigurationProtection = securityLoginConfigurationProtection; +} /** * Protect against the memory leak, when the initialization of the - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1042482 - in /tomcat/trunk: ./ conf/ java/org/apache/catalina/core/ java/org/apache/catalina/loader/ java/org/apache/tomcat/util/threads/ res/confinstall/ webapps/ webapps/docs/ webapps/d
Author: slaurent Date: Sun Dec 5 22:54:05 2010 New Revision: 1042482 URL: http://svn.apache.org/viewvc?rev=1042482&view=rev Log: bug 49159: Improve ThreadLocal memory leak clean-up https://issues.apache.org/bugzilla/show_bug.cgi?id=49159 Renewing threads of the pool when a webapp is stopped Added: tomcat/trunk/java/org/apache/catalina/core/ThreadLocalLeakPreventionListener.java tomcat/trunk/java/org/apache/tomcat/util/threads/Constants.java tomcat/trunk/java/org/apache/tomcat/util/threads/LocalStrings.properties tomcat/trunk/java/org/apache/tomcat/util/threads/TaskThread.java Modified: tomcat/trunk/ (props changed) tomcat/trunk/conf/ (props changed) tomcat/trunk/conf/server.xml tomcat/trunk/java/org/apache/catalina/core/StandardContext.java tomcat/trunk/java/org/apache/catalina/core/StandardThreadExecutor.java tomcat/trunk/java/org/apache/catalina/core/mbeans-descriptors.xml tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java tomcat/trunk/java/org/apache/tomcat/util/threads/TaskQueue.java tomcat/trunk/java/org/apache/tomcat/util/threads/TaskThreadFactory.java tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java tomcat/trunk/res/confinstall/server_1.xml tomcat/trunk/webapps/ (props changed) tomcat/trunk/webapps/docs/changelog.xml tomcat/trunk/webapps/docs/config/context.xml tomcat/trunk/webapps/docs/config/executor.xml Propchange: tomcat/trunk/ -- --- svn:ignore (original) +++ svn:ignore Sun Dec 5 22:54:05 2010 @@ -1,3 +1,9 @@ -.* +.settings +.classpath +.project output build.properties +.checkstyle +.pmd +work +logs Propchange: tomcat/trunk/conf/ -- --- svn:ignore (added) +++ svn:ignore Sun Dec 5 22:54:05 2010 @@ -0,0 +1 @@ +Catalina Modified: tomcat/trunk/conf/server.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/conf/server.xml?rev=1042482&r1=1042481&r2=1042482&view=diff == --- tomcat/trunk/conf/server.xml (original) +++ tomcat/trunk/conf/server.xml Sun Dec 5 22:54:05 2010 @@ -28,6 +28,7 @@ + +
svn commit: r1042786 - in /tomcat/trunk/java/org/apache: catalina/core/ catalina/loader/ tomcat/util/threads/
Author: slaurent Date: Mon Dec 6 20:49:14 2010 New Revision: 1042786 URL: http://svn.apache.org/viewvc?rev=1042786&view=rev Log: bug 49159: Improve ThreadLocal memory leak clean-up https://issues.apache.org/bugzilla/show_bug.cgi?id=49159 Various fixes after review by markt : formatting, use string manager, svn props... Modified: tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties tomcat/trunk/java/org/apache/catalina/core/StandardContext.java tomcat/trunk/java/org/apache/catalina/core/StandardThreadExecutor.java tomcat/trunk/java/org/apache/catalina/core/ThreadLocalLeakPreventionListener.java (contents, props changed) tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java tomcat/trunk/java/org/apache/tomcat/util/threads/Constants.java (contents, props changed) tomcat/trunk/java/org/apache/tomcat/util/threads/LocalStrings.properties (props changed) tomcat/trunk/java/org/apache/tomcat/util/threads/TaskQueue.java tomcat/trunk/java/org/apache/tomcat/util/threads/TaskThread.java (contents, props changed) tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java Modified: tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties?rev=1042786&r1=1042785&r2=1042786&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties Mon Dec 6 20:49:14 2010 @@ -238,6 +238,8 @@ standardWrapper.unavailable=Marking serv standardWrapper.unloadException=Servlet {0} threw unload() exception standardWrapper.unloading=Cannot allocate servlet {0} because it is being unloaded standardWrapper.waiting=Waiting for {0} instance(s) to be deallocated +threadLocalLeakPreventionListener.lifecycleEvent.error=Exception processing lifecycle event {0} +threadLocalLeakPreventionListener.containerEvent.error=Exception processing container event {0} defaultInstanceManager.restrictedServletsResource=Restricted servlets property file not found defaultInstanceManager.privilegedServlet=Servlet of class {0} is privileged and cannot be loaded by this web application Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1042786&r1=1042785&r2=1042786&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Mon Dec 6 20:49:14 2010 @@ -2489,9 +2489,10 @@ public class StandardContext extends Con return this.renewThreadsWhenStoppingContext; } -public void setRenewThreadsWhenStoppingContext(boolean renewThreadsWhenStoppingContext) { +public void setRenewThreadsWhenStoppingContext( +boolean renewThreadsWhenStoppingContext) { boolean oldRenewThreadsWhenStoppingContext = -this.renewThreadsWhenStoppingContext; +this.renewThreadsWhenStoppingContext; this.renewThreadsWhenStoppingContext = renewThreadsWhenStoppingContext; support.firePropertyChange("renewThreadsWhenStoppingContext", oldRenewThreadsWhenStoppingContext, Modified: tomcat/trunk/java/org/apache/catalina/core/StandardThreadExecutor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardThreadExecutor.java?rev=1042786&r1=1042785&r2=1042786&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/StandardThreadExecutor.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/StandardThreadExecutor.java Mon Dec 6 20:49:14 2010 @@ -88,7 +88,8 @@ public class StandardThreadExecutor exte * renewing all threads at the same time, this delay is observed between 2 * threads being renewed. */ -protected long threadRenewalDelay = 1000L; +protected long threadRenewalDelay = +org.apache.tomcat.util.threads.Constants.DEFAULT_THREAD_RENEWAL_DELAY; private TaskQueue taskqueue = null; // -- Constructors Modified: tomcat/trunk/java/org/apache/catalina/core/ThreadLocalLeakPreventionListener.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ThreadLocalLeakPreventionListener.java?rev=1042786&r1=1042785&r2=1042786&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/ThreadLocalLeakPreventionListener.ja
svn commit: r1044083 - /tomcat/trunk/java/org/apache/catalina/core/ThreadLocalLeakPreventionListener.java
Author: slaurent Date: Thu Dec 9 18:55:04 2010 New Revision: 1044083 URL: http://svn.apache.org/viewvc?rev=1044083&view=rev Log: bug 49159: Improve ThreadLocal memory leak clean-up https://issues.apache.org/bugzilla/show_bug.cgi?id=49159 some formatting after discussion over the list (operator at the end of line, unnecessary cast) Modified: tomcat/trunk/java/org/apache/catalina/core/ThreadLocalLeakPreventionListener.java Modified: tomcat/trunk/java/org/apache/catalina/core/ThreadLocalLeakPreventionListener.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ThreadLocalLeakPreventionListener.java?rev=1044083&r1=1044082&r2=1044083&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/ThreadLocalLeakPreventionListener.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/ThreadLocalLeakPreventionListener.java Thu Dec 9 18:55:04 2010 @@ -71,8 +71,8 @@ public class ThreadLocalLeakPreventionLi public void lifecycleEvent(LifecycleEvent event) { try { Lifecycle lifecycle = event.getLifecycle(); -if (Lifecycle.AFTER_START_EVENT.equals(event.getType()) -&& lifecycle instanceof Server) { +if (Lifecycle.AFTER_START_EVENT.equals(event.getType()) && +lifecycle instanceof Server) { // when the server starts, we register ourself as listener for // all context // as well as container event listener so that we know when new @@ -81,8 +81,8 @@ public class ThreadLocalLeakPreventionLi registerListenersForServer(server); } -if (Lifecycle.AFTER_STOP_EVENT.equals(event.getType()) -&& lifecycle instanceof Context) { +if (Lifecycle.AFTER_STOP_EVENT.equals(event.getType()) && +lifecycle instanceof Context) { stopIdleThreads((Context) lifecycle); } } catch (Exception e) { @@ -145,8 +145,8 @@ public class ThreadLocalLeakPreventionLi protected void processContainerAddChild(Container parent, Container child) { if (log.isDebugEnabled()) -log.debug("Process addChild[parent=" + parent + ",child=" + child -+ "]"); +log.debug("Process addChild[parent=" + parent + ",child=" + child + +"]"); if (child instanceof Context) { registerContextListener((Context) child); @@ -158,22 +158,18 @@ public class ThreadLocalLeakPreventionLi } -protected void processContainerRemoveChild(Container parent, +protected void processContainerRemoveChild(Container parent, Container child) { if (log.isDebugEnabled()) -log.debug("Process removeChild[parent=" + parent + ",child=" -+ child + "]"); +log.debug("Process removeChild[parent=" + parent + ",child=" + +child + "]"); if (child instanceof Context) { Context context = (Context) child; context.removeLifecycleListener(this); -} else if (child instanceof Host) { -Host host = (Host) child; -host.removeContainerListener(this); -} else if (child instanceof Engine) { -Engine engine = (Engine) child; -engine.removeContainerListener(this); +} else if (child instanceof Host || child instanceof Engine) { +child.removeContainerListener(this); } } @@ -186,9 +182,10 @@ public class ThreadLocalLeakPreventionLi *of its parent Service. */ private void stopIdleThreads(Context context) { -if (context instanceof StandardContext && +if (context instanceof StandardContext && !((StandardContext) context).getRenewThreadsWhenStoppingContext()) { -log.debug("Not renewing threads when the context is stopping, it is configured not to do it."); +log.debug("Not renewing threads when the context is stopping, " ++ "it is configured not to do it."); return; } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1044088 - /tomcat/trunk/
Author: slaurent Date: Thu Dec 9 18:59:14 2010 New Revision: 1044088 URL: http://svn.apache.org/viewvc?rev=1044088&view=rev Log: ignore work and logs directories as discussed on dev list Modified: tomcat/trunk/ (props changed) Propchange: tomcat/trunk/ -- --- svn:ignore (original) +++ svn:ignore Thu Dec 9 18:59:14 2010 @@ -1,3 +1,5 @@ .* output build.properties +work +logs - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1044145 - in /tomcat/trunk: java/org/apache/catalina/core/ java/org/apache/tomcat/util/threads/ test/org/apache/tomcat/util/threads/
Author: slaurent Date: Thu Dec 9 22:11:27 2010 New Revision: 1044145 URL: http://svn.apache.org/viewvc?rev=1044145&view=rev Log: bug 49159: Improve ThreadLocal memory leak clean-up https://issues.apache.org/bugzilla/show_bug.cgi?id=49159 Use a dedicated thread when calling web application code when it is started and stopped (calls to Listeners, Filters, Servlets). Added: tomcat/trunk/java/org/apache/tomcat/util/threads/DedicatedThreadExecutor.java (with props) tomcat/trunk/test/org/apache/tomcat/util/threads/ tomcat/trunk/test/org/apache/tomcat/util/threads/DedicatedThreadExecutorTest.java (with props) Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1044145&r1=1044144&r2=1044145&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Thu Dec 9 22:11:27 2010 @@ -37,6 +37,7 @@ import java.util.Map; import java.util.Set; import java.util.Stack; import java.util.TreeMap; +import java.util.concurrent.Callable; import javax.management.ListenerNotFoundException; import javax.management.MBeanNotificationInfo; @@ -117,6 +118,7 @@ import org.apache.tomcat.JarScanner; import org.apache.tomcat.util.ExceptionUtils; import org.apache.tomcat.util.modeler.Registry; import org.apache.tomcat.util.scan.StandardJarScanner; +import org.apache.tomcat.util.threads.DedicatedThreadExecutor; /** * Standard implementation of the Context interface. Each @@ -4966,6 +4968,7 @@ public class StandardContext extends Con } } +DedicatedThreadExecutor temporaryExecutor = new DedicatedThreadExecutor(); try { // Create context attributes that will be required @@ -4992,7 +4995,21 @@ public class StandardContext extends Con // Configure and call application event listeners if (ok) { -if (!listenerStart()) { +// we do it in a dedicated thread for memory leak protection, in +// case the Listeners registers some ThreadLocals that they +// forget to cleanup +Boolean listenerStarted = +temporaryExecutor.execute(new Callable() { +public Boolean call() throws Exception { +ClassLoader old = bindThread(); +try { +return listenerStart(); +} finally { +unbindThread(old); +} +} +}); +if (!listenerStarted) { log.error( "Error listenerStart"); ok = false; } @@ -5013,20 +5030,48 @@ public class StandardContext extends Con // Configure and call application filters if (ok) { -if (!filterStart()) { -log.error( "Error filterStart"); +// we do it in a dedicated thread for memory leak protection, in +// case the Filters register some ThreadLocals that they forget +// to cleanup +Boolean filterStarted = +temporaryExecutor.execute(new Callable() { +public Boolean call() throws Exception { +ClassLoader old = bindThread(); +try { +return filterStart(); +} finally { +unbindThread(old); +} +} +}); +if (!filterStarted) { +log.error("Error filterStart"); ok = false; } } // Load and initialize all "load on startup" servlets if (ok) { -loadOnStartup(findChildren()); +// we do it in a dedicated thread for memory leak protection, in +// case the Servlets register some ThreadLocals that they forget +// to cleanup +temporaryExecutor.execute(new Callable() { +public Void call() throws Exception { +ClassLoader old = bindThread(); +try { +loadOnStartup(findChildren()); +return null; +}
svn commit: r1044746 - /tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
Author: slaurent Date: Sun Dec 12 00:10:39 2010 New Revision: 1044746 URL: http://svn.apache.org/viewvc?rev=1044746&view=rev Log: bug 50459: StandardContext.bindThread() and unbindThread() are not symmetrical and not limited to current thread https://issues.apache.org/bugzilla/show_bug.cgi?id=50459 This fixes the bug that was introduced by http://svn.apache.org/viewvc?rev=1044145&view=rev (introduced a dedicated thread when starting and stopping web applications to avoid mem leak) Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1044746&r1=1044745&r2=1044746&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Sun Dec 12 00:10:39 2010 @@ -4862,10 +4862,10 @@ public class StandardContext extends Con if ((loader != null) && (loader instanceof Lifecycle)) ((Lifecycle) loader).start(); -// Unbinding thread +// since the loader just started, the webapp classloader is now +// created by calling unbindThread and bindThread in a row, we +// setup the current Thread CCL to be the webapp classloader unbindThread(oldCCL); - -// Binding thread oldCCL = bindThread(); // Initialize logger again. Other components might have used it too early, @@ -5542,7 +5542,7 @@ public class StandardContext extends Con (getLoader().getClassLoader()); } -DirContextURLStreamHandler.bind(getResources()); +DirContextURLStreamHandler.bindThread(getResources()); if (isUseNaming()) { try { @@ -5563,16 +5563,13 @@ public class StandardContext extends Con */ private void unbindThread(ClassLoader oldContextClassLoader) { -Thread.currentThread().setContextClassLoader(oldContextClassLoader); - -oldContextClassLoader = null; - if (isUseNaming()) { ContextBindings.unbindThread(this, this); } -DirContextURLStreamHandler.unbind(); +DirContextURLStreamHandler.unbindThread(); +Thread.currentThread().setContextClassLoader(oldContextClassLoader); } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1044747 - /tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
Author: slaurent Date: Sun Dec 12 00:16:33 2010 New Revision: 1044747 URL: http://svn.apache.org/viewvc?rev=1044747&view=rev Log: bug 50459: StandardContext.bindThread() and unbindThread() are not symmetrical and not limited to current thread https://issues.apache.org/bugzilla/show_bug.cgi?id=50459 Fixed incorrect comment in code Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1044747&r1=1044746&r2=1044747&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Sun Dec 12 00:16:33 2010 @@ -4863,8 +4863,9 @@ public class StandardContext extends Con ((Lifecycle) loader).start(); // since the loader just started, the webapp classloader is now -// created by calling unbindThread and bindThread in a row, we -// setup the current Thread CCL to be the webapp classloader +// created. +// By calling unbindThread and bindThread in a row, we setup the +// current Thread CCL to be the webapp classloader unbindThread(oldCCL); oldCCL = bindThread(); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1044951 - /tomcat/tc6.0.x/trunk/STATUS.txt
Author: slaurent Date: Sun Dec 12 22:53:33 2010 New Revision: 1044951 URL: http://svn.apache.org/viewvc?rev=1044951&view=rev Log: bug 50459: StandardContext.bindThread() and unbindThread() are not symmetrical and not limited to current thread https://issues.apache.org/bugzilla/show_bug.cgi?id=50459 Modified: tomcat/tc6.0.x/trunk/STATUS.txt Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1044951&r1=1044950&r2=1044951&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Sun Dec 12 22:53:33 2010 @@ -300,3 +300,9 @@ PATCHES PROPOSED TO BACKPORT: http://svn.apache.org/viewvc?view=revision&revision=1044266 +1: markt, kkolinko -1: + +* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50459 + StandardContext.bindThread() and unbindThread() are not symmetrical and not + limited to current thread + http://people.apache.org/~slaurent/patches/2010-12-12_BZ50459_bindThread_tc6.patch + +1: slaurent \ No newline at end of file - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1044952 - /tomcat/tc6.0.x/trunk/
Author: slaurent Date: Sun Dec 12 22:55:12 2010 New Revision: 1044952 URL: http://svn.apache.org/viewvc?rev=1044952&view=rev Log: svn:ignore work and logs directories as discussed on dev list Modified: tomcat/tc6.0.x/trunk/ (props changed) Propchange: tomcat/tc6.0.x/trunk/ -- --- svn:ignore (original) +++ svn:ignore Sun Dec 12 22:55:12 2010 @@ -3,3 +3,5 @@ .settings output build.properties +work +logs - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1050150 - in /tomcat/trunk/java/org/apache/catalina/core: LocalStrings.properties LocalStrings_es.properties LocalStrings_fr.properties StandardContext.java
Author: slaurent Date: Thu Dec 16 20:40:36 2010 New Revision: 1050150 URL: http://svn.apache.org/viewvc?rev=1050150&view=rev Log: bug 48822: Include contest name in reload and stop log statements https://issues.apache.org/bugzilla/show_bug.cgi?id=48822 Modified: tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties tomcat/trunk/java/org/apache/catalina/core/LocalStrings_es.properties tomcat/trunk/java/org/apache/catalina/core/LocalStrings_fr.properties tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Modified: tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties?rev=1050150&r1=1050149&r2=1050150&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties Thu Dec 16 20:40:36 2010 @@ -141,7 +141,8 @@ standardContext.startFailed=Context [{0} standardContext.startingLoader=Exception starting Loader standardContext.startingManager=Exception starting Manager standardContext.startingWrapper=Exception starting Wrapper for servlet {0} -standardContext.stoppingContext=Exception stopping Context +standardContext.startingContext=Exception starting Context {0} +standardContext.stoppingContext=Exception stopping Context {0} standardContext.stoppingLoader=Exception stopping Loader standardContext.stoppingManager=Exception stopping Manager standardContext.stoppingWrapper=Exception stopping Wrapper for servlet {0} Modified: tomcat/trunk/java/org/apache/catalina/core/LocalStrings_es.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/LocalStrings_es.properties?rev=1050150&r1=1050149&r2=1050150&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/LocalStrings_es.properties (original) +++ tomcat/trunk/java/org/apache/catalina/core/LocalStrings_es.properties Thu Dec 16 20:40:36 2010 @@ -100,7 +100,7 @@ standardContext.parameter.duplicate = Du standardContext.parameter.required = Es necesario poner nombre de par\u00E1metro y valor de par\u00E1metro standardContext.reloadingCompleted = Se ha completado la Regarga de este Contexto standardContext.reloadingFailed = Fall\u00F3 la recarga de este Contexto debido a errores previos -standardContext.reloadingStarted = Ha comenzado la recarga de este Contexto +standardContext.reloadingStarted = Ha comenzado la recarga de Contexto {0} standardContext.resourcesStart = Error arrancando Recursos est\u00E1ticos standardContext.securityConstraint.pattern = {0} inv\u00E1lida en restricci\u00F3n de seguridad standardContext.servletMap.name = El mapeo de Servlet especifica un nombre de servlet desconocido {0} @@ -110,7 +110,7 @@ standardContext.startFailed = Fall\u00F3 standardContext.startingLoader = Excepci\u00F3n arrancando Cargador standardContext.startingManager = Excepci\u00F3n arrancando Gestor standardContext.startingWrapper = Excepci\u00F3n arrancando Arropador (Wrapper) para servlet {0} -standardContext.stoppingContext = Excepci\u00F3n parando Context +standardContext.stoppingContext = Excepci\u00F3n parando Context {0} standardContext.stoppingLoader = Excepci\u00F3n parando Cargador standardContext.stoppingManager = Excepci\u00F3n parando Gestor standardContext.stoppingWrapper = Excepci\u00F3n parando Arropador (Wrapper) para servlet {0} Modified: tomcat/trunk/java/org/apache/catalina/core/LocalStrings_fr.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/LocalStrings_fr.properties?rev=1050150&r1=1050149&r2=1050150&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/LocalStrings_fr.properties (original) +++ tomcat/trunk/java/org/apache/catalina/core/LocalStrings_fr.properties Thu Dec 16 20:40:36 2010 @@ -78,7 +78,7 @@ standardContext.parameter.duplicate=Para standardContext.parameter.required=Le nom de param\u00e8tre ainsi que la valeur du param\u00e8tre sont requis standardContext.reloadingCompleted=Le rechargement de ce contexte est termin\u00e9 standardContext.reloadingFailed=Le rechargement de ce contexte a \u00e9chou\u00e9 suite \u00e0 une erreur pr\u00e9c\u00e9dente -standardContext.reloadingStarted=Le rechargement de ce contexte a d\u00e9marr\u00e9 +standardContext.reloadingStarted=Le rechargement du contexte {0} a d\u00e9marr\u00e9 standardContext.requestListener.requestInit=Une exception lors de l''envoi de requ\u00eate a initi\u00e9 un \u00e9v\u00e8nement cycle de vie (lifecycle event) pour l''instance de classe \u00e0 l''\u00e9coute (listener) {0} standardContext.requestListe
svn commit: r1050160 - in /tomcat: tc6.0.x/trunk/STATUS.txt trunk/webapps/docs/changelog.xml
Author: slaurent Date: Thu Dec 16 21:07:55 2010 New Revision: 1050160 URL: http://svn.apache.org/viewvc?rev=1050160&view=rev Log: bug 48822: Include contest name in reload and stop log statements https://issues.apache.org/bugzilla/show_bug.cgi?id=48822 changelog + proposed for tomcat 6 Modified: tomcat/tc6.0.x/trunk/STATUS.txt tomcat/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=1050160&r1=1050159&r2=1050160&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Thu Dec 16 21:07:55 2010 @@ -317,5 +317,11 @@ PATCHES PROPOSED TO BACKPORT: * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50460 Avoid leak caused by using a cached exception instance http://svn.apache.org/viewvc?rev=1044987&view=rev - +1: kkolinko + +1: kkolinko, slaurent -1: + +* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48822 + Include context name in reload and stop log statements. + http://people.apache.org/~slaurent/patches/2010-12-16_BZ48822_context_name_on_reload-tc6.patch + +1: slaurent + -1: \ No newline at end of file Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1050160&r1=1050159&r2=1050160&view=diff == --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Thu Dec 16 21:07:55 2010 @@ -61,6 +61,11 @@ 48692: Provide option to parse application/x-www-form-urlencoded PUT requests. (schultz) + +48822: Include context name in case of error while stopping +or starting a context during its reload. Patch provided by Marc +Guillemot. (slaurent) + 48837: Extend thread local memory leak detection to include classes loaded by subordinate class loaders to the web - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1051682 - in /tomcat/trunk/java/org/apache/tomcat/util/threads: LocalStrings.properties ThreadPoolExecutor.java res/LocalStrings.properties res/LocalStrings_es.properties res/LocalStrings
Author: slaurent Date: Tue Dec 21 22:26:55 2010 New Revision: 1051682 URL: http://svn.apache.org/viewvc?rev=1051682&view=rev Log: bug 49159: Improve ThreadLocal memory leak clean-up https://issues.apache.org/bugzilla/show_bug.cgi?id=49159 - merged LocalStrings.properties file from package o.a.t.u.threads to o.a.t.u.threads.res - removed 3 i18n keys that are no longer used by tc7. They were used by the old ThreadPool implementation of tc6 Removed: tomcat/trunk/java/org/apache/tomcat/util/threads/LocalStrings.properties Modified: tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java tomcat/trunk/java/org/apache/tomcat/util/threads/res/LocalStrings.properties tomcat/trunk/java/org/apache/tomcat/util/threads/res/LocalStrings_es.properties tomcat/trunk/java/org/apache/tomcat/util/threads/res/LocalStrings_fr.properties tomcat/trunk/java/org/apache/tomcat/util/threads/res/LocalStrings_ja.properties Modified: tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java?rev=1051682&r1=1051681&r2=1051682&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java Tue Dec 21 22:26:55 2010 @@ -42,7 +42,7 @@ public class ThreadPoolExecutor extends * The string manager for this package. */ protected static final StringManager sm = StringManager -.getManager(Constants.Package); +.getManager("org.apache.tomcat.util.threads.res"); private static final Log log = LogFactory.getLog(ThreadPoolExecutor.class); Modified: tomcat/trunk/java/org/apache/tomcat/util/threads/res/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/threads/res/LocalStrings.properties?rev=1051682&r1=1051681&r2=1051682&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/threads/res/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/tomcat/util/threads/res/LocalStrings.properties Tue Dec 21 22:26:55 2010 @@ -13,6 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -threadpool.busy=All threads ({0}) are currently busy, waiting. Increase maxThreads ({1}) or check the servlet status -threadpool.max_threads_too_low=maxThreads setting ({0}) too low, set to {1} -threadpool.thread_error=Caught exception ({0}) executing {1}, terminating thread +threadPoolExecutor.threadStoppedToAvoidPotentialLeak=Stopping thread {0} to avoid potential memory leaks after a context was stopped. Modified: tomcat/trunk/java/org/apache/tomcat/util/threads/res/LocalStrings_es.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/threads/res/LocalStrings_es.properties?rev=1051682&r1=1051681&r2=1051682&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/threads/res/LocalStrings_es.properties (original) +++ tomcat/trunk/java/org/apache/tomcat/util/threads/res/LocalStrings_es.properties Tue Dec 21 22:26:55 2010 @@ -13,6 +13,3 @@ # See the License for the specific language governing permissions and # limitations under the License. -threadpool.busy=Todos los hilos ({0}) est\u00e1n ahora ocupados, esperando. Incremente maxThreads ({1}) o revise el estado del servlet -threadpool.max_threads_too_low=valor de maxThreads ({0}) demasiado bajo, puesto a {1} -threadpool.thread_error=Cogida excepci\u00f3n ({0}) ejecutando {1}, terminando hilo Modified: tomcat/trunk/java/org/apache/tomcat/util/threads/res/LocalStrings_fr.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/threads/res/LocalStrings_fr.properties?rev=1051682&r1=1051681&r2=1051682&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/threads/res/LocalStrings_fr.properties (original) +++ tomcat/trunk/java/org/apache/tomcat/util/threads/res/LocalStrings_fr.properties Tue Dec 21 22:26:55 2010 @@ -13,6 +13,3 @@ # See the License for the specific language governing permissions and # limitations under the License. -threadpool.busy=Tous les threads ({0}) sont actuellement occup\u00e9s, attente. Augmentez maxThreads ({1}) ou v\u00e9rifiez le servlet status -threadpool.max_threads_too_low=le r\u00e9glage maxThreads ({0}) est trop bas, mis \u00e0 {1} -threadpool.thread_error=R\u00e9ception d''une exception ({0}) en ex\u00e9cutant {1}, arr\u00eat du thread Modified: tomcat/trunk/java/
svn commit: r1056553 - in /tomcat/trunk: java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java java/org/apache/catalina/core/LocalStrings.properties webapps/docs/changelog.xml webapps/doc
Author: slaurent Date: Fri Jan 7 22:56:30 2011 New Revision: 1056553 URL: http://svn.apache.org/viewvc?rev=1056553&view=rev Log: bug 50556: improve JreMemoryLeakPreventionListener against leak caused by LdapPoolManager https://issues.apache.org/bugzilla/show_bug.cgi?id=50556 Modified: tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties tomcat/trunk/webapps/docs/changelog.xml tomcat/trunk/webapps/docs/config/listeners.xml Modified: tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java?rev=1056553&r1=1056552&r2=1056553&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java Fri Jan 7 22:56:30 2011 @@ -35,6 +35,8 @@ import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.res.StringManager; +import com.sun.jndi.ldap.LdapPoolManager; + /** * Provide a workaround for known places where the Java Runtime environment can * cause a memory leak or lock files. @@ -162,6 +164,20 @@ public class JreMemoryLeakPreventionList this.xmlParsingProtection = xmlParsingProtection; } +/** + * {...@link LdapPoolManager} spawns a thread when it is initialized if the + * system property com.sun.jndi.ldap.connect.pool.timeout is + * greater than 0. + * That thread inherits the context class loader of the current thread, so + * that there my be a web application class loader leak if the web app + * is the first to use {...@link LdapPoolManager}. + */ +private boolean ldapPoolProtection = true; +public boolean isLdapPoolProtection() { return ldapPoolProtection; } +public void setLdapPoolProtection(boolean ldapPoolProtection) { +this.ldapPoolProtection = ldapPoolProtection; +} + @Override public void lifecycleEvent(LifecycleEvent event) { // Initialise these classes when Tomcat starts @@ -358,6 +374,22 @@ public class JreMemoryLeakPreventionList e); } } + +if (ldapPoolProtection) { +try { +Class.forName("com.sun.jndi.ldap.LdapPoolManager"); +} catch (ClassNotFoundException e) { +if (System.getProperty("java.vendor").startsWith( +"Sun")) { +log.error(sm.getString( +"jreLeakListener.ldapPoolManagerFail"), e); +} else { +log.debug(sm.getString( +"jreLeakListener.ldapPoolManagerFail"), e); +} +} +} + } finally { Thread.currentThread().setContextClassLoader(loader); } Modified: tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties?rev=1056553&r1=1056552&r2=1056553&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties Fri Jan 7 22:56:30 2011 @@ -82,6 +82,7 @@ jreLeakListener.gcDaemonFail=Failed to t jreLeakListener.jarUrlConnCacheFail=Failed to disable Jar URL connection caching by default jreLeakListener.xmlParseFail=Error whilst attempting to prevent memory leaks during XML parsing jreLeakListener.authPolicyFail=Error whilst attempting to prevent memory leak in javax.security.auth.Policy class +jreLeakListener.ldapPoolManagerFail=Failed to trigger creation of the com.sun.jndi.ldap.LdapPoolManager class during Tomcat start to prevent possible memory leaks. This is expected on non-Sun JVMs. naming.wsdlFailed=Failed to find wsdl file: {0} naming.bindFailed=Failed to bind object: {0} naming.jmxRegistrationFailed=Failed to register in JMX: {0} Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1056553&r1=1056552&r2=1056553&view=diff == --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Fri Jan 7 22:56:30 2011 @@ -200,6 +200,13
svn commit: r1056557 - /tomcat/tc6.0.x/trunk/STATUS.txt
Author: slaurent Date: Fri Jan 7 23:17:36 2011 New Revision: 1056557 URL: http://svn.apache.org/viewvc?rev=1056557&view=rev Log: proposed bacport on tc 6 for bug 50556: improve JreMemoryLeakPreventionListener against leak caused by LdapPoolManager https://issues.apache.org/bugzilla/show_bug.cgi?id=50556 Modified: tomcat/tc6.0.x/trunk/STATUS.txt Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1056557&r1=1056556&r2=1056557&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Fri Jan 7 23:17:36 2011 @@ -203,3 +203,9 @@ PATCHES PROPOSED TO BACKPORT: Patch is trivial so not provided. +1: mturk, jfclere -1: + +* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50556 + Improve JreMemoryLeakPreventionListener against leak caused by LdapPoolManager + Patch tc 6: http://people.apache.org/~slaurent/patches/2011-01-07_BZ50556_jre_leak_ldapPoolManager.patch + +1: slaurent + -1: \ No newline at end of file - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1090003 - in /tomcat/trunk: java/org/apache/catalina/valves/LocalStrings.properties java/org/apache/catalina/valves/StuckThreadDetectionValve.java java/org/apache/catalina/valves/mbeans-d
Author: slaurent Date: Thu Apr 7 20:50:28 2011 New Revision: 1090003 URL: http://svn.apache.org/viewvc?rev=1090003&view=rev Log: https://issues.apache.org/bugzilla/show_bug.cgi?id=50306 StuckThreadDetectionValve, based on code proposed by TomLu Added: tomcat/trunk/java/org/apache/catalina/valves/StuckThreadDetectionValve.java (with props) Modified: tomcat/trunk/java/org/apache/catalina/valves/LocalStrings.properties tomcat/trunk/java/org/apache/catalina/valves/mbeans-descriptors.xml tomcat/trunk/webapps/docs/config/valve.xml Modified: tomcat/trunk/java/org/apache/catalina/valves/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/LocalStrings.properties?rev=1090003&r1=1090002&r2=1090003&view=diff == --- tomcat/trunk/java/org/apache/catalina/valves/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/catalina/valves/LocalStrings.properties Thu Apr 7 20:50:28 2011 @@ -44,6 +44,10 @@ remoteIpValve.syntax=Invalid regular exp sslValve.certError=Failed to process certificate string [{0}] to create a java.security.cert.X509Certificate object sslValve.invalidProvider=The SSL provider specified on the connector associated with this request of [{0}] is invalid. The certificate data could not be processed. +#Stuck thread detection Valve +stuckThreadDetectionValve.notifyStuckThreadDetected=Thread "{0}" has been active for {1} milliseconds (since {2}) to serve the same request for {4} and may be stuck (configured threshold for this StuckThreadDetectionValve is {5} seconds). There is/are {3} thread(s) in total that are monitored by this Valve and may be stuck. +stuckThreadDetectionValve.notifyStuckThreadCompleted=Thread "{0}" was previously reported to be stuck but has completed. It was active for approximately {1} milliseconds.{2,choice,0#|0< There is/are still {2} thread(s) that are monitored by this Valve and may be stuck.} + # HTTP status reports http.100=The client may continue ({0}). http.101=The server is switching protocols according to the "Upgrade" header ({0}). Added: tomcat/trunk/java/org/apache/catalina/valves/StuckThreadDetectionValve.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/StuckThreadDetectionValve.java?rev=1090003&view=auto == --- tomcat/trunk/java/org/apache/catalina/valves/StuckThreadDetectionValve.java (added) +++ tomcat/trunk/java/org/apache/catalina/valves/StuckThreadDetectionValve.java Thu Apr 7 20:50:28 2011 @@ -0,0 +1,302 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.catalina.valves; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Queue; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.atomic.AtomicInteger; + +import javax.servlet.ServletException; + +import org.apache.catalina.LifecycleException; +import org.apache.catalina.connector.Request; +import org.apache.catalina.connector.Response; +import org.apache.juli.logging.Log; +import org.apache.juli.logging.LogFactory; +import org.apache.tomcat.util.res.StringManager; + +/** + * This valve allows to detect requests that take a long time to process, which might + * indicate that the thread that is processing it is stuck. + * Based on code proposed by TomLu in Bugzilla entry #50306 + * + * @author slaurent + * + */ +public class StuckThreadDetectionValve extends ValveBase { + +/** + * The descriptive information related to this implementation. + */ +private static final String info = +"org.apache.catalina.valves.StuckThreadDetectionValve/1.0"; +/** + * Logger + */ +private static final Log log = LogFactory.getLog(StuckThreadDetectionValve.class); + +/** + * The string manager for this package. + */ +private static final StringManager sm = +StringMan
svn commit: r1090441 - /tomcat/trunk/webapps/docs/changelog.xml
Author: slaurent Date: Fri Apr 8 20:51:37 2011 New Revision: 1090441 URL: http://svn.apache.org/viewvc?rev=1090441&view=rev Log: changelog for r1090003 / StuckThreadDetectionValve Modified: tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1090441&r1=1090440&r2=1090441&view=diff == --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Fri Apr 8 20:51:37 2011 @@ -56,6 +56,11 @@ print not just the value of the first header, but of the all of them, separated by commas. (kkolinko) + +50306: New StuckThreadDetectionValve to detect requests that take a +long time to process, which might indicate that their processing threads are +stuck. (slaurent) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1090468 - /tomcat/trunk/webapps/docs/changelog.xml
Author: slaurent Date: Fri Apr 8 22:10:37 2011 New Revision: 1090468 URL: http://svn.apache.org/viewvc?rev=1090468&view=rev Log: bug 50306: Detect stuck threads complement to changelog Modified: tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1090468&r1=1090467&r2=1090468&view=diff == --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Fri Apr 8 22:10:37 2011 @@ -59,7 +59,7 @@ 50306: New StuckThreadDetectionValve to detect requests that take a long time to process, which might indicate that their processing threads are -stuck. (slaurent) +stuck. (slaurent, based on a patch provided by TomLu) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1090470 - /tomcat/tc6.0.x/trunk/STATUS.txt
Author: slaurent Date: Fri Apr 8 22:12:47 2011 New Revision: 1090470 URL: http://svn.apache.org/viewvc?rev=1090470&view=rev Log: proposed backport of bug 50306: Detect stuck threads Modified: tomcat/tc6.0.x/trunk/STATUS.txt Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1090470&r1=1090469&r2=1090470&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Fri Apr 8 22:12:47 2011 @@ -201,3 +201,7 @@ PATCHES PROPOSED TO BACKPORT: http://svn.apache.org/viewvc?view=revision&revision=1090022 +1: schultz -1: + +* Add StuckThreadDetectionValve + https://github.com/sylvainlaurent/tomcat60/commit/252334f958877221ecb2dc64ee0fd12bb77e360b + +1: slaurent - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1593392 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/threads/ webapps/docs/
Author: slaurent Date: Thu May 8 19:36:10 2014 New Revision: 1593392 URL: http://svn.apache.org/r1593392 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56492 Avoid eclipse debugger pausing on uncaught exceptions when tomcat renews its threads Added: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/threads/StopPooledThreadException.java - copied unchanged from r1593132, tomcat/trunk/java/org/apache/tomcat/util/threads/StopPooledThreadException.java Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/threads/TaskThread.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ -- Merged /tomcat/trunk:r1593132 Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/threads/TaskThread.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/threads/TaskThread.java?rev=1593392&r1=1593391&r2=1593392&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/threads/TaskThread.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/threads/TaskThread.java Thu May 8 19:36:10 2014 @@ -16,22 +16,26 @@ */ package org.apache.tomcat.util.threads; +import org.apache.juli.logging.Log; +import org.apache.juli.logging.LogFactory; + /** * A Thread implementation that records the time at which it was created. * */ public class TaskThread extends Thread { +private static final Log log = LogFactory.getLog(TaskThread.class); private final long creationTime; public TaskThread(ThreadGroup group, Runnable target, String name) { -super(group, target, name); +super(group, new WrappingRunnable(target), name); this.creationTime = System.currentTimeMillis(); } public TaskThread(ThreadGroup group, Runnable target, String name, long stackSize) { -super(group, target, name, stackSize); +super(group, new WrappingRunnable(target), name, stackSize); this.creationTime = System.currentTimeMillis(); } @@ -42,4 +46,26 @@ public class TaskThread extends Thread { return creationTime; } +/** + * Wraps a {@link Runnable} to swallow any {@link StopPooledThreadException} + * instead of letting it go and potentially trigger a break in a debugger. + */ +private static class WrappingRunnable implements Runnable { +private Runnable wrappedRunnable; +WrappingRunnable(Runnable wrappedRunnable) { +this.wrappedRunnable = wrappedRunnable; +} +@Override +public void run() { +try { +wrappedRunnable.run(); +} catch(StopPooledThreadException exc) { +//expected : we just swallow the exception to avoid disturbing +//debuggers like eclipse's +log.debug("Thread exiting on purpose", exc); +} +} + +} + } Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java?rev=1593392&r1=1593391&r2=1593392&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java Thu May 8 19:36:10 2014 @@ -16,7 +16,6 @@ */ package org.apache.tomcat.util.threads; -import java.lang.Thread.UncaughtExceptionHandler; import java.util.concurrent.BlockingQueue; import java.util.concurrent.RejectedExecutionException; import java.util.concurrent.RejectedExecutionHandler; @@ -25,8 +24,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; -import org.apache.juli.logging.Log; -import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.res.StringManager; /** @@ -44,8 +41,6 @@ public class ThreadPoolExecutor extends protected static final StringManager sm = StringManager .getManager("org.apache.tomcat.util.threads.res"); -private static final Log log = LogFactory.getLog(ThreadPoolExecutor.class); - /** * The number of tasks submitted but not yet finished. This includes tasks * in the queue and tasks that have been handed to a worker thread but the @@ -117,16 +112,7 @@ public class ThreadPoolExecutor extends "threadPoolExecutor.threadStoppedToAvoidPotentialLeak",
svn commit: r1593132 - in /tomcat/trunk: java/org/apache/tomcat/util/threads/StopPooledThreadException.java java/org/apache/tomcat/util/threads/TaskThread.java java/org/apache/tomcat/util/threads/Thre
Author: slaurent Date: Wed May 7 20:39:07 2014 New Revision: 1593132 URL: http://svn.apache.org/r1593132 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56492 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56492 Avoid eclipse debugger pausing on uncaught exceptions when tomcat renews its threads Added: tomcat/trunk/java/org/apache/tomcat/util/threads/StopPooledThreadException.java Modified: tomcat/trunk/java/org/apache/tomcat/util/threads/TaskThread.java tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java tomcat/trunk/webapps/docs/changelog.xml Added: tomcat/trunk/java/org/apache/tomcat/util/threads/StopPooledThreadException.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/threads/StopPooledThreadException.java?rev=1593132&view=auto == --- tomcat/trunk/java/org/apache/tomcat/util/threads/StopPooledThreadException.java (added) +++ tomcat/trunk/java/org/apache/tomcat/util/threads/StopPooledThreadException.java Wed May 7 20:39:07 2014 @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.tomcat.util.threads; + + +/** + * A custom {@link RuntimeException} thrown by the {@link ThreadPoolExecutor} + * to signal that the thread should be disposed of. + */ +public class StopPooledThreadException extends RuntimeException { + +private static final long serialVersionUID = 1L; + +public StopPooledThreadException(String msg) { +super(msg); +} +} Modified: tomcat/trunk/java/org/apache/tomcat/util/threads/TaskThread.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/threads/TaskThread.java?rev=1593132&r1=1593131&r2=1593132&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/threads/TaskThread.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/threads/TaskThread.java Wed May 7 20:39:07 2014 @@ -16,22 +16,26 @@ */ package org.apache.tomcat.util.threads; +import org.apache.juli.logging.Log; +import org.apache.juli.logging.LogFactory; + /** * A Thread implementation that records the time at which it was created. * */ public class TaskThread extends Thread { +private static final Log log = LogFactory.getLog(TaskThread.class); private final long creationTime; public TaskThread(ThreadGroup group, Runnable target, String name) { -super(group, target, name); +super(group, new WrappingRunnable(target), name); this.creationTime = System.currentTimeMillis(); } public TaskThread(ThreadGroup group, Runnable target, String name, long stackSize) { -super(group, target, name, stackSize); +super(group, new WrappingRunnable(target), name, stackSize); this.creationTime = System.currentTimeMillis(); } @@ -42,4 +46,26 @@ public class TaskThread extends Thread { return creationTime; } +/** + * Wraps a {@link Runnable} to swallow any {@link StopPooledThreadException} + * instead of letting it go and potentially trigger a break in a debugger. + */ +private static class WrappingRunnable implements Runnable { +private Runnable wrappedRunnable; +WrappingRunnable(Runnable wrappedRunnable) { +this.wrappedRunnable = wrappedRunnable; +} +@Override +public void run() { +try { +wrappedRunnable.run(); +} catch(StopPooledThreadException exc) { +//expected : we just swallow the exception to avoid disturbing +//debuggers like eclipse's +log.debug("Thread exiting on purpose", exc); +} +} + +} + } Modified: tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java?rev=1593132&r1=1593131&r2=1593132&view=diff ===
svn commit: r1595331 - in /tomcat/trunk: java/org/apache/catalina/valves/ test/org/apache/catalina/valves/ webapps/docs/ webapps/docs/config/
Author: slaurent Date: Fri May 16 20:05:08 2014 New Revision: 1595331 URL: http://svn.apache.org/r1595331 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56526 Improved StuckThreadDetectionValve to allow to interrupt stuck threads. Added: tomcat/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java Modified: tomcat/trunk/java/org/apache/catalina/valves/LocalStrings.properties tomcat/trunk/java/org/apache/catalina/valves/StuckThreadDetectionValve.java tomcat/trunk/webapps/docs/changelog.xml tomcat/trunk/webapps/docs/config/valve.xml Modified: tomcat/trunk/java/org/apache/catalina/valves/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/LocalStrings.properties?rev=1595331&r1=1595330&r2=1595331&view=diff == --- tomcat/trunk/java/org/apache/catalina/valves/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/catalina/valves/LocalStrings.properties Fri May 16 20:05:08 2014 @@ -52,6 +52,7 @@ sslValve.invalidProvider=The SSL provide #Stuck thread detection Valve stuckThreadDetectionValve.notifyStuckThreadDetected=Thread "{0}" (id={6}) has been active for {1} milliseconds (since {2}) to serve the same request for {4} and may be stuck (configured threshold for this StuckThreadDetectionValve is {5} seconds). There is/are {3} thread(s) in total that are monitored by this Valve and may be stuck. stuckThreadDetectionValve.notifyStuckThreadCompleted=Thread "{0}" (id={3}) was previously reported to be stuck but has completed. It was active for approximately {1} milliseconds.{2,choice,0#|0< There is/are still {2} thread(s) that are monitored by this Valve and may be stuck.} +stuckThreadDetectionValve.notifyStuckThreadInterrupted=Thread "{0}" (id={5}) has been interrupted because it was active for {1} milliseconds (since {2}) to serve the same request for {3} and was probably stuck (configured interruption threshold for this StuckThreadDetectionValve is {4} seconds). # HTTP status reports # All status codes registered with IANA can be found at Modified: tomcat/trunk/java/org/apache/catalina/valves/StuckThreadDetectionValve.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/StuckThreadDetectionValve.java?rev=1595331&r1=1595330&r2=1595331&view=diff == --- tomcat/trunk/java/org/apache/catalina/valves/StuckThreadDetectionValve.java (original) +++ tomcat/trunk/java/org/apache/catalina/valves/StuckThreadDetectionValve.java Fri May 16 20:05:08 2014 @@ -23,7 +23,9 @@ import java.util.List; import java.util.Queue; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.Semaphore; import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; import javax.servlet.ServletException; @@ -57,11 +59,21 @@ public class StuckThreadDetectionValve e private final AtomicInteger stuckCount = new AtomicInteger(0); /** + * Keeps count of the number of stuck threads that have been interruoted + */ +private AtomicLong interruptedThreadsCount = new AtomicLong(); + +/** * In seconds. Default 600 (10 minutes). */ private int threshold = 600; /** + * In seconds. Default is -1 to disable interruption. + */ +private int interruptThreadThreshold; + +/** * The only references we keep to actual running Thread objects are in * this Map (which is automatically cleaned in invoke()s finally clause). * That way, Threads can be GC'ed, eventhough the Valve still thinks they @@ -76,7 +88,7 @@ public class StuckThreadDetectionValve e new ConcurrentLinkedQueue<>(); /** - * Specify the threshold (in seconds) used when checking for stuck threads. + * Specifies the threshold (in seconds) used when checking for stuck threads. * If <=0, the detection is disabled. The default is 600 seconds. * * @param threshold @@ -95,6 +107,22 @@ public class StuckThreadDetectionValve e } +public int getInterruptThreadThreshold() { +return interruptThreadThreshold; +} + +/** + * Specifies the threshold (in seconds) before stuck threads are interrupted. + * If <=0, the interruption is disabled. The default is -1. + * If >=0, the value must actually be >= threshold. + * + * @param interruptThreadThreshold + *The new thread interruption threshold in seconds + */ +public void setInterruptThreadThreshold(int interruptThreadThreshold) { +this.interruptThreadThreshold = interruptThreadThreshold; +} + /** * Required to enable asyn
svn commit: r1595690 - in /tomcat/trunk: java/org/apache/catalina/core/ test/org/apache/catalina/core/ webapps/docs/ webapps/docs/config/
Author: slaurent Date: Sun May 18 21:16:42 2014 New Revision: 1595690 URL: http://svn.apache.org/r1595690 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56461 New option to make context startup fail if a load-on-startup servlet fails Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java tomcat/trunk/java/org/apache/catalina/core/StandardHost.java tomcat/trunk/test/org/apache/catalina/core/TestStandardContext.java tomcat/trunk/webapps/docs/changelog.xml tomcat/trunk/webapps/docs/config/context.xml tomcat/trunk/webapps/docs/config/host.xml Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1595690&r1=1595689&r2=1595690&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Sun May 18 21:16:42 2014 @@ -810,6 +810,8 @@ public class StandardContext extends Con private String containerSciFilter; +private Boolean failCtxIfServletStartFails; + protected static final ThreadBindingListener DEFAULT_NAMING_LISTENER = (new ThreadBindingListener() { @Override public void bind() {} @@ -2627,8 +2629,32 @@ public class StandardContext extends Con this.renewThreadsWhenStoppingContext); } -// Context Methods +public Boolean getFailCtxIfServletStartFails() { +return failCtxIfServletStartFails; +} + +public void setFailCtxIfServletStartFails( +Boolean failCtxIfServletStartFails) { +Boolean oldFailCtxIfServletStartFails = this.failCtxIfServletStartFails; +this.failCtxIfServletStartFails = failCtxIfServletStartFails; +support.firePropertyChange("failCtxIfServletStartFails", +oldFailCtxIfServletStartFails, +failCtxIfServletStartFails); +} + +protected boolean getComputedFailCtxIfServletStartFails() { +if(failCtxIfServletStartFails != null) { +return failCtxIfServletStartFails.booleanValue(); +} +//else look at Host config +if(getParent() instanceof StandardHost) { +return ((StandardHost)getParent()).isFailCtxIfServletStartFails(); +} +//else +return false; +} +// Context Methods /** * Add a new Listener class name to the set of Listeners @@ -4897,7 +4923,7 @@ public class StandardContext extends Con * @param children Array of wrappers for all currently defined * servlets (including those not declared load on startup) */ -public void loadOnStartup(Container children[]) { +public boolean loadOnStartup(Container children[]) { // Collect "load on startup" servlets that need to be initialized TreeMap> map = new TreeMap<>(); @@ -4925,10 +4951,14 @@ public class StandardContext extends Con getName()), StandardWrapper.getRootCause(e)); // NOTE: load errors (including a servlet that throws // UnavailableException from tht init() method) are NOT -// fatal to application startup +// fatal to application startup, excepted if failDeploymentIfServletLoadedOnStartupFails is specified +if(getComputedFailCtxIfServletStartFails()) { +return false; +} } } } +return true; } @@ -5201,7 +5231,10 @@ public class StandardContext extends Con // Load and initialize all "load on startup" servlets if (ok) { -loadOnStartup(findChildren()); +if (!loadOnStartup(findChildren())){ +log.error("Error loadOnStartup"); +ok = false; +} } // Start ContainerBackgroundProcessor thread Modified: tomcat/trunk/java/org/apache/catalina/core/StandardHost.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardHost.java?rev=1595690&r1=1595689&r2=1595690&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/StandardHost.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/StandardHost.java Sun May 18 21:16:42 2014 @@ -182,6 +182,8 @@ public class StandardHost extends Contai private boolean undeployOldVersions = false; +private boolean failCtxIfServletStartFails = false; + // ---
svn commit: r1596047 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/valves/ test/org/apache/catalina/valves/ webapps/docs/ webapps/docs/config/
Author: slaurent Date: Mon May 19 20:26:23 2014 New Revision: 1596047 URL: http://svn.apache.org/r1596047 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56526 Improved StuckThreadDetectionValve to allow to interrupt stuck threads. merged r1595331 from trunk Added: tomcat/tc7.0.x/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java - copied unchanged from r1595331, tomcat/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/LocalStrings.properties tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/StuckThreadDetectionValve.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml tomcat/tc7.0.x/trunk/webapps/docs/config/valve.xml Propchange: tomcat/tc7.0.x/trunk/ -- Merged /tomcat/trunk:r1595331 Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/LocalStrings.properties?rev=1596047&r1=1596046&r2=1596047&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/LocalStrings.properties (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/LocalStrings.properties Mon May 19 20:26:23 2014 @@ -57,6 +57,7 @@ sslValve.invalidProvider=The SSL provide #Stuck thread detection Valve stuckThreadDetectionValve.notifyStuckThreadDetected=Thread "{0}" (id={6}) has been active for {1} milliseconds (since {2}) to serve the same request for {4} and may be stuck (configured threshold for this StuckThreadDetectionValve is {5} seconds). There is/are {3} thread(s) in total that are monitored by this Valve and may be stuck. stuckThreadDetectionValve.notifyStuckThreadCompleted=Thread "{0}" (id={3}) was previously reported to be stuck but has completed. It was active for approximately {1} milliseconds.{2,choice,0#|0< There is/are still {2} thread(s) that are monitored by this Valve and may be stuck.} +stuckThreadDetectionValve.notifyStuckThreadInterrupted=Thread "{0}" (id={5}) has been interrupted because it was active for {1} milliseconds (since {2}) to serve the same request for {3} and was probably stuck (configured interruption threshold for this StuckThreadDetectionValve is {4} seconds). # HTTP status reports # All status codes registered with IANA can be found at Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/StuckThreadDetectionValve.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/StuckThreadDetectionValve.java?rev=1596047&r1=1596046&r2=1596047&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/StuckThreadDetectionValve.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/StuckThreadDetectionValve.java Mon May 19 20:26:23 2014 @@ -23,7 +23,9 @@ import java.util.List; import java.util.Queue; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.Semaphore; import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; import javax.servlet.ServletException; @@ -62,11 +64,21 @@ public class StuckThreadDetectionValve e private final AtomicInteger stuckCount = new AtomicInteger(0); /** + * Keeps count of the number of stuck threads that have been interruoted + */ +private AtomicLong interruptedThreadsCount = new AtomicLong(); + +/** * In seconds. Default 600 (10 minutes). */ private int threshold = 600; /** + * In seconds. Default is -1 to disable interruption. + */ +private int interruptThreadThreshold; + +/** * The only references we keep to actual running Thread objects are in * this Map (which is automatically cleaned in invoke()s finally clause). * That way, Threads can be GC'ed, eventhough the Valve still thinks they @@ -81,7 +93,7 @@ public class StuckThreadDetectionValve e new ConcurrentLinkedQueue(); /** - * Specify the threshold (in seconds) used when checking for stuck threads. + * Specifies the threshold (in seconds) used when checking for stuck threads. * If <=0, the detection is disabled. The default is 600 seconds. * * @param threshold @@ -100,6 +112,22 @@ public class StuckThreadDetectionValve e } +public int getInterruptThreadThreshold() { +return interruptThreadThreshold; +} + +/** + * Specifies the threshold (in seconds) before stuck threads are interrupted. + * If <=0, the in
svn commit: r1596052 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/core/ test/org/apache/catalina/core/ webapps/docs/ webapps/docs/config/
Author: slaurent Date: Mon May 19 20:42:56 2014 New Revision: 1596052 URL: http://svn.apache.org/r1596052 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56461 New option to make context startup fail if a load-on-startup servlet fails merged r1595690 from trunk 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/java/org/apache/catalina/core/StandardHost.java tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContext.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml tomcat/tc7.0.x/trunk/webapps/docs/config/context.xml tomcat/tc7.0.x/trunk/webapps/docs/config/host.xml Propchange: tomcat/tc7.0.x/trunk/ -- Merged /tomcat/trunk:r1595690 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=1596052&r1=1596051&r2=1596052&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 Mon May 19 20:42:56 2014 @@ -893,6 +893,8 @@ public class StandardContext extends Con private String containerSciFilter; +private Boolean failCtxIfServletStartFails; + // - Context Properties @@ -2816,8 +2818,32 @@ public class StandardContext extends Con this.renewThreadsWhenStoppingContext); } -// Context Methods +public Boolean getFailCtxIfServletStartFails() { +return failCtxIfServletStartFails; +} +public void setFailCtxIfServletStartFails( +Boolean failCtxIfServletStartFails) { +Boolean oldFailCtxIfServletStartFails = this.failCtxIfServletStartFails; +this.failCtxIfServletStartFails = failCtxIfServletStartFails; +support.firePropertyChange("failCtxIfServletStartFails", +oldFailCtxIfServletStartFails, +failCtxIfServletStartFails); +} + +protected boolean getComputedFailCtxIfServletStartFails() { +if(failCtxIfServletStartFails != null) { +return failCtxIfServletStartFails.booleanValue(); +} +//else look at Host config +if(getParent() instanceof StandardHost) { +return ((StandardHost)getParent()).isFailCtxIfServletStartFails(); +} +//else +return false; +} + +// Context Methods @Override public void addApplicationListener(String listener) { @@ -5184,7 +5210,7 @@ public class StandardContext extends Con * @param children Array of wrappers for all currently defined * servlets (including those not declared load on startup) */ -public void loadOnStartup(Container children[]) { +public boolean loadOnStartup(Container children[]) { // Collect "load on startup" servlets that need to be initialized TreeMap> map = @@ -5213,10 +5239,14 @@ public class StandardContext extends Con getName()), StandardWrapper.getRootCause(e)); // NOTE: load errors (including a servlet that throws // UnavailableException from tht init() method) are NOT -// fatal to application startup +// fatal to application startup, excepted if failDeploymentIfServletLoadedOnStartupFails is specified +if(getComputedFailCtxIfServletStartFails()) { +return false; +} } } } +return true; } @@ -5490,7 +5520,10 @@ public class StandardContext extends Con // Load and initialize all "load on startup" servlets if (ok) { -loadOnStartup(findChildren()); +if (!loadOnStartup(findChildren())){ +log.error("Error loadOnStartup"); +ok = false; +} } // Start ContainerBackgroundProcessor thread Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardHost.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardHost.java?rev=1596052&r1=1596051&r2=1596052&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardHost.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/
svn commit: r1596390 - /tomcat/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java
Author: slaurent Date: Tue May 20 20:19:01 2014 New Revision: 1596390 URL: http://svn.apache.org/r1596390 Log: fixed timing and enclosed thread.join in a finally to avoid stopping the webapp before the request is finished (in case of assertion failure) Modified: tomcat/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java Modified: tomcat/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java?rev=1596390&r1=1596389&r2=1596390&view=diff == --- tomcat/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java (original) +++ tomcat/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java Tue May 20 20:19:01 2014 @@ -51,7 +51,7 @@ public class TestStuckThreadDetectionVal @Test public void testDetection() throws Exception { // second, we test the actual effect of the flag on the startup -StuckingServlet stuckingServlet = new StuckingServlet(5000L); +StuckingServlet stuckingServlet = new StuckingServlet(6000L); Wrapper servlet = Tomcat.addServlet(context, "myservlet", stuckingServlet); servlet.addMapping("/myservlet"); @@ -78,14 +78,15 @@ public class TestStuckThreadDetectionVal }; asyncThread.start(); - -Thread.sleep(1000L); -Assert.assertEquals(0, valve.getStuckThreadIds().length); - -Thread.sleep(2000L); -Assert.assertEquals(1, valve.getStuckThreadIds().length); - -asyncThread.join(); +try { +Thread.sleep(500L); +Assert.assertEquals(0, valve.getStuckThreadIds().length); + +Thread.sleep(3000L); +Assert.assertEquals(1, valve.getStuckThreadIds().length); +} finally { +asyncThread.join(); +} Assert.assertFalse(stuckingServlet.wasInterrupted); Assert.assertTrue(result.toString().startsWith("OK")); } @@ -101,7 +102,7 @@ public class TestStuckThreadDetectionVal StuckThreadDetectionValve valve = new StuckThreadDetectionValve(); valve.setThreshold(2); -valve.setInterruptThreadThreshold(4); +valve.setInterruptThreadThreshold(5); context.addValve(valve); context.setBackgroundProcessorDelay(1); tomcat.start(); @@ -122,18 +123,16 @@ public class TestStuckThreadDetectionVal }; asyncThread.start(); - -Thread.sleep(1000L); -Assert.assertEquals(0, valve.getStuckThreadIds().length); - -Thread.sleep(3000L); -Assert.assertEquals(1, valve.getStuckThreadIds().length); - -Thread.sleep(3000L); -Assert.assertTrue(stuckingServlet.wasInterrupted); -Assert.assertEquals(0, valve.getStuckThreadIds().length); - -asyncThread.join(); +try { +Thread.sleep(4000L); +Assert.assertEquals(1, valve.getStuckThreadIds().length); + +Thread.sleep(4000L); +Assert.assertTrue(stuckingServlet.wasInterrupted); +Assert.assertEquals(0, valve.getStuckThreadIds().length); +} finally { +asyncThread.join(); +} Assert.assertTrue(result.toString().startsWith("OK")); } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1596401 - in /tomcat/tc7.0.x/trunk: ./ test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java
Author: slaurent Date: Tue May 20 20:36:14 2014 New Revision: 1596401 URL: http://svn.apache.org/r1596401 Log: fixed timing and enclosed thread.join in a finally to avoid stopping the webapp before the request is finished (in case of assertion failure) Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java Propchange: tomcat/tc7.0.x/trunk/ -- Merged /tomcat/trunk:r1596390 Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java?rev=1596401&r1=1596400&r2=1596401&view=diff == --- tomcat/tc7.0.x/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java (original) +++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java Tue May 20 20:36:14 2014 @@ -51,7 +51,7 @@ public class TestStuckThreadDetectionVal @Test public void testDetection() throws Exception { // second, we test the actual effect of the flag on the startup -StuckingServlet stuckingServlet = new StuckingServlet(5000L); +StuckingServlet stuckingServlet = new StuckingServlet(6000L); Wrapper servlet = Tomcat.addServlet(context, "myservlet", stuckingServlet); servlet.addMapping("/myservlet"); @@ -78,14 +78,15 @@ public class TestStuckThreadDetectionVal }; asyncThread.start(); - -Thread.sleep(1000L); -Assert.assertEquals(0, valve.getStuckThreadIds().length); - -Thread.sleep(2000L); -Assert.assertEquals(1, valve.getStuckThreadIds().length); - -asyncThread.join(); +try { +Thread.sleep(500L); +Assert.assertEquals(0, valve.getStuckThreadIds().length); + +Thread.sleep(3000L); +Assert.assertEquals(1, valve.getStuckThreadIds().length); +} finally { +asyncThread.join(); +} Assert.assertFalse(stuckingServlet.wasInterrupted); Assert.assertTrue(result.toString().startsWith("OK")); } @@ -101,7 +102,7 @@ public class TestStuckThreadDetectionVal StuckThreadDetectionValve valve = new StuckThreadDetectionValve(); valve.setThreshold(2); -valve.setInterruptThreadThreshold(4); +valve.setInterruptThreadThreshold(5); context.addValve(valve); context.setBackgroundProcessorDelay(1); tomcat.start(); @@ -122,18 +123,16 @@ public class TestStuckThreadDetectionVal }; asyncThread.start(); - -Thread.sleep(1000L); -Assert.assertEquals(0, valve.getStuckThreadIds().length); - -Thread.sleep(3000L); -Assert.assertEquals(1, valve.getStuckThreadIds().length); - -Thread.sleep(3000L); -Assert.assertTrue(stuckingServlet.wasInterrupted); -Assert.assertEquals(0, valve.getStuckThreadIds().length); - -asyncThread.join(); +try { +Thread.sleep(4000L); +Assert.assertEquals(1, valve.getStuckThreadIds().length); + +Thread.sleep(4000L); +Assert.assertTrue(stuckingServlet.wasInterrupted); +Assert.assertEquals(0, valve.getStuckThreadIds().length); +} finally { +asyncThread.join(); +} Assert.assertTrue(result.toString().startsWith("OK")); } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1596415 - /tomcat/site/trunk/docs/ci.html
Author: slaurent Date: Tue May 20 20:58:55 2014 New Revision: 1596415 URL: http://svn.apache.org/r1596415 Log: fixed URLs to documentation snapshots Modified: tomcat/site/trunk/docs/ci.html Modified: tomcat/site/trunk/docs/ci.html URL: http://svn.apache.org/viewvc/tomcat/site/trunk/docs/ci.html?rev=1596415&r1=1596414&r2=1596415&view=diff == --- tomcat/site/trunk/docs/ci.html (original) +++ tomcat/site/trunk/docs/ci.html Tue May 20 20:58:55 2014 @@ -263,14 +263,14 @@ prepared and published by ASF Buildbot, -http://ci.apache.org/projects/tomcat/tomcat8/docs/index.html"; rel="nofollow">Tomcat trunk (8.0.x) +http://ci.apache.org/projects/tomcat/tomcat8/index.html"; rel="nofollow">Tomcat trunk (8.0.x) -http://ci.apache.org/projects/tomcat/tomcat7/docs/index.html"; rel="nofollow">Tomcat 7.0.x +http://ci.apache.org/projects/tomcat/tomcat7/index.html"; rel="nofollow">Tomcat 7.0.x -http://ci.apache.org/projects/tomcat/tomcat6/docs/index.html"; rel="nofollow">Tomcat 6.0.x +http://ci.apache.org/projects/tomcat/tomcat6/index.html"; rel="nofollow">Tomcat 6.0.x - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1596664 - /tomcat/site/trunk/docs/ci.html
Author: slaurent Date: Wed May 21 19:52:19 2014 New Revision: 1596664 URL: http://svn.apache.org/r1596664 Log: reverted "fixed URLs to documentation snapshots" because they are actually correct. There's a misconfig in the buildbot Modified: tomcat/site/trunk/docs/ci.html Modified: tomcat/site/trunk/docs/ci.html URL: http://svn.apache.org/viewvc/tomcat/site/trunk/docs/ci.html?rev=1596664&r1=1596663&r2=1596664&view=diff == --- tomcat/site/trunk/docs/ci.html (original) +++ tomcat/site/trunk/docs/ci.html Wed May 21 19:52:19 2014 @@ -263,14 +263,14 @@ prepared and published by ASF Buildbot, -http://ci.apache.org/projects/tomcat/tomcat8/index.html"; rel="nofollow">Tomcat trunk (8.0.x) +http://ci.apache.org/projects/tomcat/tomcat8/docs/index.html"; rel="nofollow">Tomcat trunk (8.0.x) -http://ci.apache.org/projects/tomcat/tomcat7/index.html"; rel="nofollow">Tomcat 7.0.x +http://ci.apache.org/projects/tomcat/tomcat7/docs/index.html"; rel="nofollow">Tomcat 7.0.x -http://ci.apache.org/projects/tomcat/tomcat6/index.html"; rel="nofollow">Tomcat 6.0.x +http://ci.apache.org/projects/tomcat/tomcat6/docs/index.html"; rel="nofollow">Tomcat 6.0.x - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1596971 - /tomcat/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java
Author: slaurent Date: Thu May 22 21:24:06 2014 New Revision: 1596971 URL: http://svn.apache.org/r1596971 Log: hopefully fixed timing issue in TestStuckThreadDetectionValve when the test is run on ASF buildbot... Modified: tomcat/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java Modified: tomcat/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java?rev=1596971&r1=1596970&r2=1596971&view=diff == --- tomcat/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java (original) +++ tomcat/trunk/test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java Thu May 22 21:24:06 2014 @@ -51,7 +51,7 @@ public class TestStuckThreadDetectionVal @Test public void testDetection() throws Exception { // second, we test the actual effect of the flag on the startup -StuckingServlet stuckingServlet = new StuckingServlet(6000L); +StuckingServlet stuckingServlet = new StuckingServlet(8000L); Wrapper servlet = Tomcat.addServlet(context, "myservlet", stuckingServlet); servlet.addMapping("/myservlet"); @@ -82,10 +82,12 @@ public class TestStuckThreadDetectionVal Thread.sleep(500L); Assert.assertEquals(0, valve.getStuckThreadIds().length); -Thread.sleep(3000L); +Thread.sleep(5000L); Assert.assertEquals(1, valve.getStuckThreadIds().length); } finally { -asyncThread.join(); +asyncThread.join(2); +// check that we did not reach the join timeout +Assert.assertFalse(asyncThread.isAlive()); } Assert.assertFalse(stuckingServlet.wasInterrupted); Assert.assertTrue(result.toString().startsWith("OK")); @@ -127,12 +129,13 @@ public class TestStuckThreadDetectionVal Thread.sleep(4000L); Assert.assertEquals(1, valve.getStuckThreadIds().length); -Thread.sleep(4000L); -Assert.assertTrue(stuckingServlet.wasInterrupted); -Assert.assertEquals(0, valve.getStuckThreadIds().length); } finally { -asyncThread.join(); +asyncThread.join(2); +// check that we did not reach the join timeout +Assert.assertFalse(asyncThread.isAlive()); } +Assert.assertTrue(stuckingServlet.wasInterrupted); +Assert.assertEquals(0, valve.getStuckThreadIds().length); Assert.assertTrue(result.toString().startsWith("OK")); } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org