[jboss-remoting-issues] [JBoss JIRA] (JBREM-1305) Maximum number of client sockets in MicroSocketClientInvoker increases after timeout waiting for a free socket
Torsten Neise (JIRA)
jira-events at lists.jboss.org
Tue May 8 11:27:17 EDT 2012
Torsten Neise created JBREM-1305:
------------------------------------
Summary: 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.5.4.SP3, 2.2.4, 2.5.2.SP3 (Flounder), 2.5.0.SP2 (Flounder) , 2.4.0.SP1 (Pinto)
Environment: all
Reporter: Torsten Neise
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: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-remoting-issues
mailing list