[JBoss JIRA] Created: (JBREM-1242) Fix deadlock between Client and MicroRemoteClientInvoker
by Ron Sigal (JIRA)
Fix deadlock between Client and MicroRemoteClientInvoker
--------------------------------------------------------
Key: JBREM-1242
URL: https://jira.jboss.org/browse/JBREM-1242
Project: JBoss Remoting
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 2.5.3.SP1, 2.2.3.SP3
Reporter: Ron Sigal
Assignee: Ron Sigal
Fix For: 2.5.3.SP2, 2.2.3.SP4
1. a. org.jboss.remoting.Client.setupClientLease() calls MicroRemoteClientInvoker.establishLease()
b. org.jboss.remoting.MicroRemoteClientInvoker.establishLease() synchronizes on MicroRemoteClientInvoker.clientLeaseLock and calls Client.addConnectionListener()
c. Client.addConnectionListener() synchronizes on Client.connectionValidatorLock
2. a. Client.addConnectionListener() synchronizes on Client.connectionValidatorLock and calls new ConnectionValidator()
b. new ConnectionValidator() calls MicroRemoteClientInvoker.getLeasePinger(), which synchronizes on MicroRemoteClientInvoker.clientLeaseLock
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 11 months
[JBoss JIRA] Created: (JBREM-1226) Sockets created by bisocket secondary ServerSocket should be configured properly
by Ron Sigal (JIRA)
Sockets created by bisocket secondary ServerSocket should be configured properly
--------------------------------------------------------------------------------
Key: JBREM-1226
URL: https://jira.jboss.org/browse/JBREM-1226
Project: JBoss Remoting
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 2.2.3.SP2, 2.5.2.SP3 (Flounder)
Reporter: Ron Sigal
Assignee: Ron Sigal
Fix For: 2.2.3.SP3, 2.5.2.SP4 (Flounder)
Sockets created by org.jboss.remoting.transport.socket.SocketServerInvoker are configured by
protected void configureSocket(Socket s) throws SocketException
{
s.setReuseAddress(getReuseAddress());
if (keepAliveSet) s.setKeepAlive(keepAlive);
if (oOBInlineSet) s.setOOBInline(oOBInline);
if (receiveBufferSize > -1) s.setReceiveBufferSize(receiveBufferSize);
if (sendBufferSize > -1) s.setSendBufferSize(sendBufferSize);
if (soLingerSet &&
soLingerDuration > 0) s.setSoLinger(soLinger, soLingerDuration);
if (trafficClass > -1) s.setTrafficClass(trafficClass);
}
but configureSocket() is not called for sockets created by org.jboss.remoting.transport.bisocket.BisocketServerInvoker.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 11 months
[JBoss JIRA] Created: (JBREM-1227) Fix deadlock between MicroRemoteClientInvoker and RemotingClassLoader
by Ron Sigal (JIRA)
Fix deadlock between MicroRemoteClientInvoker and RemotingClassLoader
---------------------------------------------------------------------
Key: JBREM-1227
URL: https://jira.jboss.org/browse/JBREM-1227
Project: JBoss Remoting
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 2.5.2.SP3 (Flounder)
Reporter: Ron Sigal
Assignee: Ron Sigal
Fix For: 2.5.2.SP4 (Flounder)
The following deadlock can occur:
1. Thread T1 reads a response with an object whose class is not available locally, so it uses its org.jboss.remoting.loading.RemotingClassLoader to try to download the class
a. java.lang.ClassLoader.loadClassInternal() acquires a lock on itself (an instance of RemotingClassLoader)
b. RemotingClassLoader uses its copy of an org.jboss.remoting.loading.ClassByteClassLoader to try to download the class
c. ClassByteClassLoader calls org.jboss.remoting.MicroRemoteClientInvoker.invoke(), which tries to synchronize on MicroRemoteClientInvoker.class as it sets up an UnMarshaller with a ClassLoader
2. Thread T2 attempts to make an invocation
a. MicroRemoteClientInvoker.invoke() acquires a lock on MicroRemoteClientInvoker.class
b. MicroRemoteClientInvoker.invoke() calls the synchronized method RemotingClassLoader.setUserClassLoader(), which tries to acquire a lock on the RemotingClassLoader
Deadlock.
The only two synchronized methods in RemotingClassLoader are setUserClassLoader() and unsetUserClassLoader(), which are both called from MicroRemoteClientInvoker.invoke(). The call to setUserClassLoader() is already done while the MicroRemoteClientInvoker.class lock is held. If the call to unsetUserClassLoader() is made with the same lock, then setUserClassLoader() and unsetClassLoader() don't have to be synchronized. That will eliminate the deadlock because step 2b is removed.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 11 months