[jboss-jira] [JBoss JIRA] Commented: (JBMESSAGING-1812) Thread.sleep() is called with lock held in class ServerManagement

Howard Gao (JIRA) jira-events at lists.jboss.org
Wed Jun 30 10:32:46 EDT 2010


    [ https://jira.jboss.org/browse/JBMESSAGING-1812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12537479#action_12537479 ] 

Howard Gao commented on JBMESSAGING-1812:
-----------------------------------------

Hi Wendy,

Please log any JBM 2.0 (now HornetQ) issues at 
https://jira.jboss.org/browse/HORNETQ

There is no longer JBM 2.0. The project is now HornetQ and it's latest version is 2.1.1.Final. Please check out the new version.

Thanks
Howard


> 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
>   Original Estimate: 1 hour
>  Remaining Estimate: 1 hour
>
> 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

        


More information about the jboss-jira mailing list