[jboss-user] [Remoting] - Bug in Remoting 2.0

hceylan do-not-reply at jboss.com
Thu Oct 12 16:30:42 EDT 2006


I think I have spotted a bug in Remoting 2.0.

I use remoting 2.0 coupled with Jboss 4.0.4 hosted EJB3 container.

After the upgrade to remoting 2.0, I started getting calls for clients stopping to repond users. 

Exception was thrown from: Microcontainer Line 706.


        throw new SocketException("Can not obtain client socket connection from pool.  Have waited " +
                                   numberOfRetries + " seconds for available connection (" + usedPooled + " in use)");


Having investigated the code I have found that if a client waits for some time so long as server times out the connection and closes the socket, remoting client gets the very same socket from the pool, incresing usedPooled by one.

Then in the transport writes the invocation to the socket and checks back the response. However due to the socket being closed by the server, socketexception is received and number of tries is incremented by starting over by getting a socket from the pool. 

This simply means that socket sis dropped without decrementing the use count kept in "usedPooled "

Therefore, after some time usedPooled overflows the max which is by default 50 and client process cannot do remoting any more.

Just before numberof tries exhausts in the transport method, flushConnectionPool is called. IMHO this has no point at all. it mereley disposes the pooled sockets. But every numberOfCallRetries times timed out socket is leaked.

My recommendation is to insert

usedPooled--;

into exception handling at line 359.

Upon confirmation I may open up a JIRA and post the formal patch.

Hasan Ceylan



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

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



More information about the jboss-user mailing list