activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Lugt (JIRA)" <>
Subject [jira] Commented: (AMQ-1020) Slow consumer terminally blocks both client and broker
Date Thu, 02 Nov 2006 22:50:02 GMT
    [ ] 
Rob Lugt commented on AMQ-1020:

Hi James

I'm using auto-acknowledgements (no transactions).  You are correct that the NMS prefetch
default is 1000 messages, and this threshold appears to have a bearing on when the consumer
(and hence the publisher) gets stuck.  Changing the prefetch size may well remove the symtoms
from my test case, but that's not really what I'm looking for.  I believe the test case exposes
a critical bug in the broker, and hence gives us an opportunity to fix the bug, which is preferable
to changing the configuration to avoid the condition (sod's law dictates that the condition
will re-emerge as soon as my application goes into production).

I think there are two crucial points here that need investigating
1) even though [auto] acknowledgements are being sent to the broker, the consumer is getting
stuck dead (i.e. no message activity is occuring once the broker becomes stuck).
2) killing the slow consumer does not rectify the situation.  This implies that the broker
is stuck in some state where it doesn't recognise the client socket has been closed.

It's probably worth noting that this problem does not occur when I disable Client1 from publishing
(even though it's still a slow consumer).  It's only when Client1 is a slow consumer and a
[fast] publisher that it falls into the dead-locked condition.

> Slow consumer terminally blocks both client and broker
> ------------------------------------------------------
>                 Key: AMQ-1020
>                 URL:
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 4.0.2
>         Environment: Broker: Windows XP, Sun JDK1.5  Client: activemq-dotnet (Trunk)
>            Reporter: Rob Lugt
> I have a multi-threaded client (client1) which is acting as both a publisher (Topic1)
and subscriber (Topic2) using a single session.  There is another client process (client2)
which publishes on Topic2.
> I have witnessed the following repeatable scenario where both clients get stuck, which
can only be rectified by restarting the broker! :-
> Client1 publishes messages to Topic1 (rate = about 30 msgs/sec).
> Client2 publishes bursts of messages to Topic2 (rate = 500 msgs/sec) 
> Client1 is a slow subscriber on Topic2
> After running in this scenario for a couple of seconds, Client1 and Client2 become stuck.
 Looking at a stack trace for Client1 I can see that it's read_loop is stuck waiting for input,
and it's publisher thread is stuck waiting for an acknowledgement to the synchronous message
send (the acknowledgement never arrives because the broker won't sent any more messages).
> Client2 is also stuck waiting for an acknowledgement to a synchronous send.
> My perception is that it appears the broker is throttling the connection because the
consumer is running slowly, but for some reason it gets into a state where all message flow
stops (even though the consumer is automatically acknowledging messages, albeit slowly). 
Furthermore, if I kill Client1 the broker doesn't recover (using a JMX console the connection
remains visible).
> The broker uses a vanilla configuration (i.e. no policies are set for the topics in quedtion).

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message