Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-6004

TcpTransportServer#socketHandlerThread should be intterrupted to stop the socket handler (daemon) thread

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.12.0
    • 5.12.1, 5.13.0
    • None
    • None
    • Patch Available

    Description

      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:

      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)
      

      I am pretty sure this can be easily fixed by interrupting the socket handler thread, as suggested by Andreas Hartmann in AMQ-3451. Please see attached patch.

      Attachments

        Activity

          People

            cshannon Christopher L. Shannon
            erikgb Erik Godding Boye
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: