]
Ron Sigal commented on JBREM-1305:
----------------------------------
org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport() now checks if
getConnection() failed with a IllegalStateException, in which case it does not call
Semaphore.release().
Unit test: org.jboss.test.remoting.transport.socket.timeout.SemaphoreGrowthTestCase.
Waiting for jenkins results.
Maximum number of client sockets in MicroSocketClientInvoker
increases after timeout waiting for a free socket
--------------------------------------------------------------------------------------------------------------
Key: JBREM-1305
URL:
https://issues.jboss.org/browse/JBREM-1305
Project: JBoss Remoting
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: transport
Affects Versions: 2.2.4, 2.5.4.SP3
Environment: all
Reporter: Torsten Neise
Assignee: Ron Sigal
Fix For: 2.2.4.SP1, 2.5.4.SP4
Maximum number of client sockets in MicroSocketClientInvoker increases after timeout
waiting for a free socket. This happens because of an illegal call of semaphore.release()
in MicroSocketClientInvoker.transport(...) after semaphore.attempt(timeToWait) returned
with false (no lock aquired) in MicroSocketClientInvoker.getConnection(...).
public class MicroSocketClientInvoker extends RemoteClientInvoker
{
...
protected Object transport(String sessionID, Object invocation, Map metadata,
Marshaller marshaller, UnMarshaller unmarshaller)
throws IOException, ConnectionFailedException, ClassNotFoundException
{
...
try
{
socketWrapper = getConnection(marshaller, unmarshaller, timeLeft);
}
...
catch (Exception e)
{
// if (bailOut)
// return null;
semaphore.release();
...
}
...
}
protected SocketWrapper getConnection(Marshaller marshaller,
UnMarshaller unmarshaller,
int timeAllowed)
throws Exception
{
long start = System.currentTimeMillis();
long timeToWait = (timeAllowed > 0) ? timeAllowed : 30000;
boolean timedout = !semaphore.attempt(timeToWait);
if (trace) log.trace(this + " obtained semaphore: " +
semaphore.permits());
if (timedout)
{
throw new IllegalStateException("Timeout waiting for a free socket");
}
...
}
...
}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: