You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Erik Godding Boye (JIRA)" <ji...@apache.org> on 2015/10/08 11:25:27 UTC

[jira] [Created] (AMQ-6004) TcpTransportServer#socketHandlerThread should be intterrupted to stop the socket handler (daemon) thread

Erik Godding Boye created AMQ-6004:
--------------------------------------

             Summary: TcpTransportServer#socketHandlerThread should be intterrupted to stop the socket handler (daemon) thread
                 Key: AMQ-6004
                 URL: https://issues.apache.org/jira/browse/AMQ-6004
             Project: ActiveMQ
          Issue Type: Bug
    Affects Versions: 5.12.0
            Reporter: Erik Godding Boye


I am trying to achieve a clean shutdown of an embedded broker in a web application running in Tomcat. When the web application is shut down, Tomcat is always complaining about a running thread:
{code}
09:09:55.948 WARN  [o.a.c.loader.WebappClassLoaderBase] [] The web application [xxx] appears to have started a thread named [ActiveMQ Transport Server Thread Handler: tcp://0.0.0.0:12345] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 sun.misc.Unsafe.park(Native Method)
 java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(Unknown Source)
 java.util.concurrent.LinkedBlockingQueue.poll(Unknown Source)
 org.apache.activemq.transport.tcp.TcpTransportServer$2.run(TcpTransportServer.java:427)
 java.lang.Thread.run(Unknown Source)
{code}

I am pretty sure this can be easily fixed by interrupting the socket handler thread, as suggested by Andreas Hartmann in [AMQ-3451|https://issues.apache.org/jira/browse/AMQ-3451?focusedCommentId=13170863&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13170863]. Please see attached patch.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)