You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2015/10/08 14:14:26 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=14948556#comment-14948556 ] 

ASF subversion and git services commented on AMQ-6004:
------------------------------------------------------

Commit 4adc8e4f4e57a4335643f49c3072e5fd531c7f27 in activemq's branch refs/heads/master from [~cshannon]
[ https://git-wip-us.apache.org/repos/asf?p=activemq.git;h=4adc8e4 ]

https://issues.apache.org/jira/browse/AMQ-6004

Calling socketHandlerThread.interrupt() on TcpTransportServer stop to
make sure the broker shutsdown cleanly.

Patch applied with thanks to Erik Godding Boye


> 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)