[jboss-user] [JBoss Remoting Users] - Client hangs when get JMS connection factory

lilin.lee do-not-reply at jboss.com
Wed Nov 11 02:49:14 EST 2009

Sometimes, my client will hang when client try to get JMS connection factory from JBoss Messaging Server. Server side exception is thrown when issue occurred:

  | 2009-10-20 18:08:09,655 ERROR [org.jboss.remoting.transport.socket.ServerThread] Worker thread initialization failure
  | java.net.SocketException: Connection reset
  | 	at java.net.SocketInputStream.read(SocketInputStream.java:168)
  | 	at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
  | 	at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
  | 	at java.io.FilterInputStream.read(FilterInputStream.java:66)
  | 	at org.jboss.remoting.transport.socket.ServerThread.readVersion(ServerThread.java:859)
  | 	at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:545)
  | 	at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:406)
  | 	at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:173)  

My JBoss Server Version is 4.2.3.GA, JBoss Remoting Version is 2.2.3 SP1, JBoss Messaging Version is 1.4.5 GA
My configuration is 

  |             <invoker transport="bisocket">
  |                <!-- There should be no reason to change these parameters - warning!
  |                     Changing them may stop JBoss Messaging working correctly -->            
  |                <attribute name="marshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
  |                <attribute name="unmarshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
  |                <attribute name="dataType" isParam="true">jms</attribute>
  |                <attribute name="socket.check_connection" isParam="true">false</attribute>               
  |                <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
  |                <attribute name="serverBindPort">4457</attribute>
  |                <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
  |                <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
  |                <attribute name="numberOfCallRetries" isParam="true">1</attribute>
  |                <attribute name="pingFrequency" isParam="true">214748364</attribute>
  |                <attribute name="pingWindowFactor" isParam="true">10</attribute>
  |                <attribute name="onewayThreadPool">org.jboss.jms.server.remoting.DirectThreadPool</attribute>               
  |                <!-- End immutable parameters -->
  |                <attribute name="stopLeaseOnFailure" isParam="true">true</attribute>
  |                <!-- Periodicity of client pings. Server window by default is twice this figure -->                               
  |                <attribute name="clientLeasePeriod" isParam="true">10000</attribute>
  |                <attribute name="validatorPingPeriod" isParam="true">10000</attribute>
  |                <attribute name="validatorPingTimeout" isParam="true">5000</attribute>
  |                <attribute name="registerCallbackListener">false</attribute>
  | 	            <attribute name="timeout" isParam="true">0</attribute>
  |                <!-- Number of seconds to wait for a connection in the client pool to become free -->
  |                <attribute name="numberOfRetries" isParam="true">10</attribute>
  |                <!-- Max Number of connections in client pool. This should be significantly higher than
  |                     the max number of sessions/consumers you expect -->
  |                <attribute name="JBM_clientMaxPoolSize" isParam="true">200</attribute>
  |                <!-- The maximum time to wait before timing out on trying to write a message to socket for delivery -->
  |                <attribute name="callbackTimeout">10000</attribute> 
  |                <attribute name="secondaryBindPort">4557</attribute>
  |                <!-- Use these parameters to specify values for binding and connecting control connections to 
  |                     work with your firewall/NAT configuration
  |                <attribute name="secondaryBindPort">xyz</attribute>                           
  |                <attribute name="secondaryConnectPort">abc</attribute>               
  |                -->
  |             </invoker>

After testing, I find,
1) if client ethernet cable is pulled, CurrentClientPoolSize of invoker bisocket does not decrease. 
2) If kill client process, CurrentClientPoolSize decrease. 
3) If CurrentClientPoolSize becomes the same with value of MaxPoolSize, new request will go to backlog queue forever (parameter timeout is 0), so client hangs.

I try to define parameter timeout as 10000, not 0, everything works fine even though client ethernet cable is pulled. It seems issue is resolved. But I got some information from JBoss web site. 

>From information, I think daemon thread should use parameter validatorPingPeriod and validatorPingTimeout to remove dead thread, not timeout. But why will parameter timeout affect daemon thread?  What's wrong with my understanding?

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4264954#4264954

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4264954

More information about the jboss-user mailing list