You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Christopher L. Shannon (JIRA)" <ji...@apache.org> on 2015/10/08 13:57:26 UTC

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

     [ https://issues.apache.org/jira/browse/AMQ-6004?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christopher L. Shannon reassigned AMQ-6004:
-------------------------------------------

    Assignee: Christopher L. Shannon

> 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
>            Assignee: Christopher L. Shannon
>         Attachments: Interrupt_socket_handler_thread_to_stop_daemon_thread.patch
>
>
> 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)