[ https://issues.apache.org/activemq/browse/AMQ-750?page=all ]
Ning Li updated AMQ-750: ------------------------ Attachment: ToolSupport.java ProducerTool.java log4j.properties Adding multi-threaded test code for the bug. Thanks for looking into the problem. > multi-threaded issues with failover transport > --------------------------------------------- > > Key: AMQ-750 > URL: https://issues.apache.org/activemq/browse/AMQ-750 > Project: ActiveMQ > Type: Bug > Components: Transport > Versions: 4.0 > Environment: Got the June 6 code using svn, and test is run on Windows > Reporter: Ning Li > Priority: Minor > Attachments: ProducerTool.java, ToolSupport.java, log4j.properties > > > Modified ProducerTool.java into multi-threaded test code: > This is the peudo code: > For ( thread 1 to 30 ) > { > Connection connection = createConnection(); > Session session = createSession(connection); > Producer producer = createProducer(session); > sendMessages(producer, 10); //each thread send 10 messages to broker, > using url = failover:tcp://localhost:61616 > } > Please turn on Debug info for log4j, otherwise you will hit other threading > issue before this one, when client shutting down, this exception will be > thrown: > Thread-13 Sending total message: 10 Total time: 203 DONE !!! > [ Thread-13] FailoverTransport DEBUG Stopped. > [cp://localhost/127.0.0.1:61616] FailoverTransport DEBUG > Transport failed, starting up reconnect task > 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:48) > at > org.apache.activemq.transport.tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:55) > at java.io.DataInputStream.readInt(DataInputStream.java:353) > at > org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:274) > at > org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:142) > at java.lang.Thread.run(Thread.java:595) > [ ActiveMQ Scheduler] InactivityMonitor DEBUG Message > sent since last write check, resetting flag > [cp://localhost/127.0.0.1:61616] FailoverTransport DEBUG > Transport failed, starting up reconnect task > java.net.SocketException: Connection reset > at java.net.SocketInputStream.read(SocketInputStream.java:168) > at > org.apache.activemq.transport.tcp.TcpBufferedInputStream.fill(TcpBufferedInputStream.java:48) > at > org.apache.activemq.transport.tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:55) > at java.io.DataInputStream.readInt(DataInputStream.java:353) > at > org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:274) > at > org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:142) > at java.lang.Thread.run(Thread.java:595) > [ ActiveMQ Task] FailoverTransport DEBUG > Attempting connect to: tcp://localhost:61616 > Thread-17 Sending total message: 10 Total time: 109 DONE !!! > [ Thread-17] FailoverTransport DEBUG Stopped. > [cp://localhost/127.0.0.1:61616] FailoverTransport DEBUG > Transport failed, starting up reconnect task > 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:48) > at > org.apache.activemq.transport.tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:55) > at java.io.DataInputStream.readInt(DataInputStream.java:353) > at > org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:274) > at > org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:142) > at java.lang.Thread.run(Thread.java:595) > Thread-14 Sending total message: 10 Total time: 328 DONE !!! > [cp://localhost/127.0.0.1:61616] FailoverTransport DEBUG > Transport failed, starting up reconnect task > 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:48) > at > org.apache.activemq.transport.tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:55) > at java.io.DataInputStream.readInt(DataInputStream.java:353) > at > org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:274) > at > org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:142) > at java.lang.Thread.run(Thread.java:595) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira