[jboss-jira] [JBoss JIRA] (JGRP-1652) TP.ProtocolAdapter ThreadLocal leak on Tomcat shutdown
Manuel Dominguez Sarmiento (JIRA)
jira-events at lists.jboss.org
Fri Jul 5 08:30:20 EDT 2013
[ https://issues.jboss.org/browse/JGRP-1652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12787855#comment-12787855 ]
Manuel Dominguez Sarmiento commented on JGRP-1652:
--------------------------------------------------
Perhaps it could be handled on TP.ProtocolAdapter.stop():
public void stop() {
TP tp=getTransport();
if(tp != null)
tp.unregisterProbeHandler(this);
-----> thread_local.remove() <-----
}
and proper handling in TUNNEL.handleDownEvent() so that it does not throw NPE when trying to access the thread_local.
> TP.ProtocolAdapter ThreadLocal leak on Tomcat shutdown
> ------------------------------------------------------
>
> Key: JGRP-1652
> URL: https://issues.jboss.org/browse/JGRP-1652
> Project: JGroups
> Issue Type: Bug
> Affects Versions: 3.3.2
> Reporter: Manuel Dominguez Sarmiento
> Assignee: Bela Ban
>
> We're getting the following Tomcat errors on shutdown:
> SEVERE: The web application [/claro-ar] appears to have started a thread named [Thread-639] but has failed to stop it. This is very likely to create a memory leak.
> Jul 04, 2013 6:16:51 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
> SEVERE: The web application [/claro-ar] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal at a5d04a6]) and a value of type [org.jgroups.protocols.TP.ProtocolAdapter] (value [session (21)]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
> Jul 04, 2013 6:16:51 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
> SEVERE: The web application [/claro-ar] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal at a5d04a6]) and a value of type [org.jgroups.protocols.TP.ProtocolAdapter] (value [claro-ar (21)]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
> This happens every single time on shutdown. This seems to be related to the current TUNNEL implementation. In TP.ProtocolAdapter:
> // kludge, only used by TUNNEL
> static final ThreadLocal<ProtocolAdapter> thread_local=new ThreadLocal<ProtocolAdapter>();
> In TUNNEL:
> // TODO [JGRP-1194] - Revisit implementation of TUNNEL and shared transport
> ProtocolAdapter adapter = ProtocolAdapter.thread_local.get();
> Since we do not use TUNNEL, we would appreciate this feature could be turned off, as it affects webapp hot redeployment.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list