Description
Hello,
There's a problem with the FailoverTransport not shutting down cleanly. It appears that it shuts down it's underlying transport, e.g. TcpTransport, but then doesn't disable it's handleTransportFailure thread, which then complains that the underlying transport has gone away, and tries to restart it again.
Looking at the code in FailoverTransport.java, there appears to be a simple fix, to check the 'started' variable in the method 'handleTransportFailure' before logging a warning and trying to restart the underlying transport.
Here's a log snippet that demonstrates the problem:
DEBUG [2008-02-04 03:44:05,752] thread:main FailoverTransport – Stopped.
DEBUG [2008-02-04 03:44:05,753] thread:main TcpTransport – Stopping transport tcp://localhost/127.0.0.1:61616
WARN [2008-02-04 03:44:05,760] thread:ActiveMQ Transport: tcp://localhost/127.0.0.1:61616 FailoverTransport – Transport failed, attempting to automatically reconnect due to: java.net.SocketException: Socket closed
java.net.SocketException: Socket closed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at org.apache.activemq.transport.tcp.TcpBufferedInputStream.fill(TcpBufferedInputStream.java:50)
at org.apache.activemq.transport.tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:58)
at java.io.DataInputStream.readInt(DataInputStream.java:351)
at org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:267)
at org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:203)
at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:195)
at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:183)
at java.lang.Thread.run(Thread.java:637)
Jason