activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Baff (JIRA)" <j...@apache.org>
Subject [jira] Closed: (AMQ-2465) MessageConsumer.receive(timeout) with prefetchSize=0 results in hang when broker goes down
Date Mon, 26 Oct 2009 19:20:52 GMT

     [ https://issues.apache.org/activemq/browse/AMQ-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Aaron Baff closed AMQ-2465.
---------------------------

       Resolution: Fixed
    Fix Version/s: 5.3.0

Sorry, I had ActiveMQ 5.1 libraries loaded by accident, after doing several tests with ActiveMQ
5.3, it appears to work as expected. I receive the exception as expected. 

> MessageConsumer.receive(timeout) with prefetchSize=0 results in hang when broker goes
down
> ------------------------------------------------------------------------------------------
>
>                 Key: AMQ-2465
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2465
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.3.0
>         Environment: WinXP, Netbeans 6.7, JDK 1.5
>            Reporter: Aaron Baff
>             Fix For: 5.3.0
>
>
> I'm doing some testing to verify that I detect and correctly handle when the broker goes
down while consuming. I came across some strange behavior where the consumers recieve(timeout)
call would hang and not throw an exception which prevented me from detecting any error, which
means I couldn't back off and take appropriate actions. I traced down the call, and it seems
that when the prefetch size is set to 0, there is a separate code path which is ActiveMQMessageConsumer:550
where it then calls the MessageDispatchChannel.dequeue(timeout) with a timeout of -1 which
the comments indicate that will wait for the broker to push the message down the connection
at which time it will be received. However, since I am stopping the broker, it seems that
the sendPullCommand() from ActiveMQMessageConsumer:513 is getting sent, but there is a race
condition with the MessageDispatchChannel.dequeue(timeout) and the code hitting the mutex.wait()
in MessageDispatchChannel:75, which doesn't have a timeout and so the broker never notifies
the client that there is a message or that it should unblock and the consumers sit there stuck.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message