Description
TcpTransport.stop() await()s on a countDownLatch that is counted down in TcpTransport.run(). When stop() is called in in the dynamic scope of run(), the countDown() will never happen. Example stack:
"ActiveMQ Transport: tcp://localhost/127.0.0.1:62002" prio=10 tid=0x0be46c00 nid=0x2dbc waiting on condition [0x0125c000..0x0125ce50]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x7f352dd0> (a java.util.concurrent.CountDownLatch$Sync) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158) at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:712)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:870)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1182)
at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:207)
at org.apache.activemq.transport.tcp.TcpTransport.stop(TcpTransport.java:440)
at org.apache.activemq.transport.InactivityMonitor.stop(InactivityMonitor.java:66)
at org.apache.activemq.transport.TransportFilter.stop(TransportFilter.java:63)
at org.apache.activemq.transport.WireFormatNegotiator.stop(WireFormatNegotiator.java:78)
at org.apache.activemq.transport.TransportFilter.stop(TransportFilter.java:63)
at org.apache.activemq.transport.TransportFilter.stop(TransportFilter.java:63)
at org.apache.activemq.util.ServiceStopper.stop(ServiceStopper.java:41) at org.apache.activemq.network.DemandForwardingBridgeSupport.stop(DemandForwardingBridgeSupport.java:340) at org.apache.activemq.util.ServiceSupport.dispose(ServiceSupport.java:40)
at org.apache.activemq.network.DiscoveryNetworkConnector.onServiceRemove(DiscoveryNetworkConnector.java:132)
at org.apache.activemq.transport.discovery.simple.SimpleDiscoveryAgent.serviceFailed(SimpleDiscoveryAgent.java:104)
at org.apache.activemq.network.DiscoveryNetworkConnector$1.bridgeFailed(DiscoveryNetworkConnector.java:179)
at org.apache.activemq.network.DemandForwardingBridgeSupport.fireBridgeFailed(DemandForwardingBridgeSupport.java:909)
at org.apache.activemq.network.DemandForwardingBridgeSupport.serviceRemoteException(DemandForwardingBridgeSupport.java:371)
at org.apache.activemq.network.DemandForwardingBridgeSupport.serviceRemoteCommand(DemandForwardingBridgeSupport.java:395)
at org.apache.activemq.network.DemandForwardingBridgeSupport$2.onCommand(DemandForwardingBridgeSupport.java:149)
at org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:100)
at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:67)
at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:134)
at org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:126) - locked <0x7f3530b0> (a org.apache.activemq.transport.InactivityMonitor$1)
at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:183)
at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:170)
at java.lang.Thread.run(Thread.java:619)