[jboss-jira] [JBoss JIRA] Closed: (JBAS-4525) JBossMQ WriteTask in UIL2 could block forever

Dimitris Andreadis (JIRA) jira-events at lists.jboss.org
Wed Jun 11 10:43:16 EDT 2008


     [ http://jira.jboss.com/jira/browse/JBAS-4525?page=all ]

Dimitris Andreadis closed JBAS-4525.
------------------------------------

    Fix Version/s: JBossAS-5.0.0.CR1
                       (was: JBossAS-5.0.0.CR2)
       Resolution: Done

> JBossMQ WriteTask in UIL2 could block forever
> ---------------------------------------------
>
>                 Key: JBAS-4525
>                 URL: http://jira.jboss.com/jira/browse/JBAS-4525
>             Project: JBoss Application Server
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: JMS (JBossMQ)
>    Affects Versions: JBossAS-4.2.1.GA
>            Reporter: Adrian Brock
>         Assigned To: Adrian Brock
>             Fix For: JBossAS-5.0.0.CR1, JBossAS-4.2.2.GA, JBossAS-4.4.0.CR1
>
>
> The JBossMQ UIL2 WriteTask shutdowns when it is signaled by the ReadTask using an Thread.interrupt().
> If however, something "eats" that interrupt status of the thread then the WriteTask will block forever and never stop.
> This leads to thread leaks.
> The solution is not to wait forever for an interrupt. Instead the thread should periodically wake up
> and check the "started" flag. e.g. Here is the suggest patch in outline
> while (true)
> {
> + synchronized (running)
> + {
> + if (WriteState != Started)
> + break;
> + }
> BaseMsg msg = null;
> try
> {
> - msg = (BaseMsg) sendQueue.take();
> + // Only wait for 10 seconds
> + msg = (BaseMsg) sendQueue.poll(10000l);
> + if (msg == null)
> + continue; // re-start the loop when no message after 10 seconds

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list