|
|
|
Looks like the problems go further than just the documentation being incorrect. On the server, it the soTimeout setting wont take into effect unless you use transport.soTimeout property.
However, trying to apply this setting to a client URL, the system bombs out Caused by: java.lang.IllegalArgumentException: Invalid connect parameters: {transport.soTimeout=180000} at org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:133) at org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:47) at org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:76) at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:235) then it would probably be better to just allow the property soTimeout, but it looks like the entire socket property settings need to have a look over, since there is no consistent way of setting these properties. And because the soTimeout property is not set, the whoe server locks up if there is a client that is deciding to stop receiving data. Example of how to make the soTimeout property work on the server
Example of how to make the soTimeout work for the server, one must of course verify that the client is picking up the option too
Thanks Filip - applied the patch in SVN revision 685808
Rob, looks like I wrote the patch with my head up my rear,
this + options.put("soTimeout", Integer.valueOf(soTimeout)); should be + options.put("soTimeout", Integer.valueOf(soTimeout)); See previous note, copy paste error in the included patch
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Lets say you have a connection between a consumer and the AMQ server, that connections gets terminated.
When a socket is closed, it doesn't really mean its closed - this is explained in:
http://java.sun.com/j2se/1.5.0/docs/guide/net/articles/connection_release.html
On the server the following will happen
yy.yy.yy.yy.61616 xx.xx.xx.xx.44674 49152 0 49330 0 CLOSE_WAIT
And inside of the AMQ you'll see the following stack trace
"ActiveMQ Transport: tcp:///xx.xx.xx.xx:44674" daemon prio=4 tid=0x002ebc88 nid=0x2a runnable [0xd10ff000..0xd10ffc70]
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at org.apache.activemq.transport.tcp.TcpBufferedOutputStream.flush(TcpBufferedOutputStream.java:105)
at java.io.DataOutputStream.flush(DataOutputStream.java:106)
at org.apache.activemq.transport.tcp.TcpTransport.oneway(TcpTransport.java:154)
at org.apache.activemq.transport.InactivityMonitor.oneway(InactivityMonitor.java:157)
at org.apache.activemq.transport.TransportFilter.oneway(TransportFilter.java:82)
at org.apache.activemq.transport.WireFormatNegotiator.oneway(WireFormatNegotiator.java:91)
at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:40)
at org.apache.activemq.broker.TransportConnection.dispatch(TransportConnection.java:1151)
at org.apache.activemq.broker.TransportConnection.processDispatch(TransportConnection.java:766)
at org.apache.activemq.broker.TransportConnection.dispatchSync(TransportConnection.java:727)
please remember, the client is no longer connected, and is no longer reading data. The server now has a CLOSE_WAIT connection and a thread that is stuck in this state.
The socketWrite0 will only return after a TCP packets has moved on the connection (which it wont since the client is no longer present) or until it times out (which it wont since soTimeout is 0)
As you can see this thread is also holding a bunch of locks, some of these interfer with other server threads, causing the system to display systems of being hung. The only work around ar this point is to restart the AMQ server.
Hope this makes sense. My recommendation would be to have a >0 soTimeout value as default, (and the property name be documented properly of course
)
best
Filip