You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2011/06/08 17:52:26 UTC
svn commit: r1133446 - in /tomcat/trunk:
java/org/apache/catalina/startup/ContextConfig.java
webapps/docs/changelog.xml
Author: markt
Date: Wed Jun 8 15:52:26 2011
New Revision: 1133446
URL: http://svn.apache.org/viewvc?rev=1133446&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51340
Fix thread-safety issue when parsing multiple web.xml files in parallel. Apache Tomcat does not do this but products that embed it may.
Modified:
tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
tomcat/trunk/webapps/docs/changelog.xml
Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1133446&r1=1133445&r2=1133446&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Wed Jun 8 15:52:26 2011
@@ -1676,13 +1676,18 @@ public class ContextConfig
// thread safe. Whilst there should only be one thread at a time
// processing a config, play safe and sync.
Digester digester;
+ WebRuleSet ruleSet;
if (fragment) {
digester = webFragmentDigester;
+ ruleSet = webFragmentRuleSet;
} else {
digester = webDigester;
+ ruleSet = webRuleSet;
}
- synchronized(digester) {
+ // Sync on the ruleSet since the same ruleSet is shared across all four
+ // digesters
+ synchronized(ruleSet) {
digester.push(dest);
digester.setErrorHandler(handler);
@@ -1713,11 +1718,7 @@ public class ContextConfig
ok = false;
} finally {
digester.reset();
- if (fragment) {
- webFragmentRuleSet.recycle();
- } else {
- webRuleSet.recycle();
- }
+ ruleSet.recycle();
}
}
}
Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1133446&r1=1133445&r2=1133446&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Jun 8 15:52:26 2011
@@ -71,6 +71,11 @@
Avoid possible NPE when logging requests received during embedded Tomcat
shutdown. (markt)
</fix>
+ <fix>
+ <bug>51340</bug>: Fix thread-safety issue when parsing multiple web.xml
+ files in parallel. Apache Tomcat does not do this but products that
+ embed it may. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org