[JBoss JIRA] Created: (JBMESSAGING-1809) Fix closed connection check in ClientSocketWrapper
by Ron Sigal (JIRA)
Fix closed connection check in ClientSocketWrapper
--------------------------------------------------
Key: JBMESSAGING-1809
URL: https://jira.jboss.org/browse/JBMESSAGING-1809
Project: JBoss Messaging
Issue Type: Bug
Affects Versions: 1.4.0.SP3.CP10
Reporter: Ron Sigal
Two problems have turned up in the closed connection checking mechanisms:
1. A regression in the default connection checking mechanism entered in JBMESSAGING-1737 "Update ClienSocketWrapper": When an instance of org.jboss.jms.client.remoting.ServerSocketWrapper closes, it writes a single org.jboss.jms.client.remoting.ClientSocketWrapper.CLOSING byte, and, prior to JBMESSAGING-1737, ClientSocketWrapper checked for the presence of >0 available bytes. However, I created a new version of ClientSocketWrapper for JBMESSAGING, based on the Remoting version of ClientSocketWrapper, and the Remoting version uses two CLOSING bytes. I accidentally included the the test for > 1 bytes.
2. The original closed connection checking mechanism, which is enabled by setting the parameter "socket.check_connection" to "true", sends a round trip byte, with value 1, from the client to the server and back. Now, Remoting uses 254 for ClientSocketWrapper.CLOSING, but, for some reason, I defined ClientSocketWrapper.CLOSING to be 1 in JBossMessaging. The 1 written by ServerSocketWrapper upon closing can be mistaken for the return of a 1 byte if the original connection checking mechanism is turned on, and a defunct connection can appear to be alive.
--
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, 10 months
[JBoss JIRA] Created: (JBMESSAGING-1812) Thread.sleep() is called with lock held in class ServerManagement
by Wendy Feng (JIRA)
Thread.sleep() is called with lock held in class ServerManagement
-----------------------------------------------------------------
Key: JBMESSAGING-1812
URL: https://jira.jboss.org/browse/JBMESSAGING-1812
Project: JBoss Messaging
Issue Type: Bug
Components: Tests and Performance
Affects Versions: 2.0.0.beta4
Reporter: Wendy Feng
ServerManagement has unefficient code as follow:
public static synchronized void kill(int i) throws Exception
{
...
try
{
while (true)
{
server.ping();
log.debug("server " + i + " still alive ...");
Thread.sleep(100);
}
}
catch (Throwable e)
{
//Ok
}
Thread.sleep(300);
log.info("server " + i + " killed and dead");
}
}
Since the kill() method has been synchronized, calling Thread.sleep() can not realease the resource to other waiting threads. It may cause poor performance or even deadlock.
--
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, 10 months