Author: remy.maucherat(a)jboss.com
Date: 2012-06-18 07:43:11 -0400 (Mon, 18 Jun 2012)
New Revision: 2043
Modified:
branches/7.0.x/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java
branches/7.0.x/java/org/apache/jasper/runtime/TagHandlerPool.java
branches/7.0.x/webapps/docs/changelog.xml
trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java
trunk/java/org/apache/jasper/runtime/TagHandlerPool.java
trunk/webapps/docs/changelog.xml
Log:
JBWEB-242: Fix rare leak with tag pooling
Modified: branches/7.0.x/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java
===================================================================
--- branches/7.0.x/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java 2012-06-14
14:11:34 UTC (rev 2042)
+++ branches/7.0.x/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java 2012-06-18
11:43:11 UTC (rev 2043)
@@ -119,7 +119,17 @@
if (ptd.current < (ptd.handlers.length - 1)) {
ptd.handlers[++ptd.current] = handler;
} else {
- handler.release();
+ try {
+ handler.release();
+ } finally {
+ if (Constants.INJECT_TAGS || Constants.USE_INSTANCE_MANAGER_FOR_TAGS) {
+ try {
+ instanceManager.destroyInstance(handler);
+ } catch (Exception e) {
+ // Ignore
+ }
+ }
+ }
}
}
Modified: branches/7.0.x/java/org/apache/jasper/runtime/TagHandlerPool.java
===================================================================
--- branches/7.0.x/java/org/apache/jasper/runtime/TagHandlerPool.java 2012-06-14 14:11:34
UTC (rev 2042)
+++ branches/7.0.x/java/org/apache/jasper/runtime/TagHandlerPool.java 2012-06-18 11:43:11
UTC (rev 2043)
@@ -148,6 +148,13 @@
}
// There is no need for other threads to wait for us to release
handler.release();
+ if (Constants.INJECT_TAGS || Constants.USE_INSTANCE_MANAGER_FOR_TAGS) {
+ try {
+ instanceManager.destroyInstance(handler);
+ } catch (Exception e) {
+ // Ignore
+ }
+ }
}
/**
Modified: branches/7.0.x/webapps/docs/changelog.xml
===================================================================
--- branches/7.0.x/webapps/docs/changelog.xml 2012-06-14 14:11:34 UTC (rev 2042)
+++ branches/7.0.x/webapps/docs/changelog.xml 2012-06-18 11:43:11 UTC (rev 2043)
@@ -45,6 +45,9 @@
<fix>
Use per webapp expression factory. (markt)
</fix>
+ <fix>
+ <jira>242</jira>: Fix rare leak with tag pooling. (remm)
+ </fix>
</changelog>
</subsection>
</section>
Modified: trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java
===================================================================
--- trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java 2012-06-14 14:11:34
UTC (rev 2042)
+++ trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java 2012-06-18 11:43:11
UTC (rev 2043)
@@ -119,7 +119,17 @@
if (ptd.current < (ptd.handlers.length - 1)) {
ptd.handlers[++ptd.current] = handler;
} else {
- handler.release();
+ try {
+ handler.release();
+ } finally {
+ if (Constants.INJECT_TAGS || Constants.USE_INSTANCE_MANAGER_FOR_TAGS) {
+ try {
+ instanceManager.destroyInstance(handler);
+ } catch (Exception e) {
+ // Ignore
+ }
+ }
+ }
}
}
Modified: trunk/java/org/apache/jasper/runtime/TagHandlerPool.java
===================================================================
--- trunk/java/org/apache/jasper/runtime/TagHandlerPool.java 2012-06-14 14:11:34 UTC (rev
2042)
+++ trunk/java/org/apache/jasper/runtime/TagHandlerPool.java 2012-06-18 11:43:11 UTC (rev
2043)
@@ -148,6 +148,13 @@
}
// There is no need for other threads to wait for us to release
handler.release();
+ if (Constants.INJECT_TAGS || Constants.USE_INSTANCE_MANAGER_FOR_TAGS) {
+ try {
+ instanceManager.destroyInstance(handler);
+ } catch (Exception e) {
+ // Ignore
+ }
+ }
}
/**
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2012-06-14 14:11:34 UTC (rev 2042)
+++ trunk/webapps/docs/changelog.xml 2012-06-18 11:43:11 UTC (rev 2043)
@@ -78,6 +78,9 @@
<fix>
Use per webapp expression factory. (markt)
</fix>
+ <fix>
+ <jira>242</jira>: Fix rare leak with tag pooling. (remm)
+ </fix>
</changelog>
</subsection>
</section>
Show replies by date