activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dean Thompson (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AMQ-1992) flow control doesn't work after first restart (if producer works in transacted mode with persistent messages)
Date Tue, 25 Nov 2008 17:05:05 GMT

    [ https://issues.apache.org/activemq/browse/AMQ-1992?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=47608#action_47608
] 

Dean Thompson commented on AMQ-1992:
------------------------------------

We ran into a different problem, but came across information that may shed light on the present
problem.

We at mSpoke had a problem (with version 5.2.0, using topics and durable subscriptions) where
all producers would lock up when we used producer flow control.  What's strange is that the
producers were *not* explicitly waiting in ActiveMQMessageProducer in the call to producerWindow.waitForSpace().
 Instead, the producers were blocked waiting for acks.  But the problem went away when we
disabled producer flow control.  

As I traced through the ActiveMQ code to try to understand what might be happening, I found
myself with two concerns:

(1) Possibly pertinent to Josip Gracin's observation above (11/3/08), I am concerned that
the calculation of available flow-control-window is based on totalling the message sizes as
measured by the producer and subtracting the message sizes as measured by the consumer (or
at least by whatever ends up producing the ack).  But the code in org.apache.activemq.command.Message#getSize()
is a bit complex; how sure are we that the same size will be reported across marshalling/unmarshalling
operations and in different contexts?

(2) In trying to understand how enabling producer flow-control might have left the producer
waiting forever for an ack that never came, I see fairly complex code in org.apache.activemq.broker.region.Topic#send
that schedules a deferred ack when the topic is full.  I believe our consumers are functioning
correctly (and indeed our whole system works once we disable producer flow-control), so I
don't see how any topic remained full forever -- yet, our producers wound up waiting for acks
forever.  So I am suspicious that the acks deferred by                   messagesWaitingForSpace.add(new
Runnable() {...} may, under some circumstances, never get sent.


> flow control doesn't work after first restart (if producer works in transacted mode with
persistent messages)
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-1992
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1992
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.1.0, 5.2.0
>         Environment: Intel MAC OSX Java (build 1.5.0_16-b06-284)
>            Reporter: Viktor Matic
>
> To reproduce BUG follow instructions:
> 1. Unpack fresh AMQ (versions 5.1.0, 5.2.0, 5.3.0-SNAPSHOT)
> 2. Edit $AMQ_HOME/examples/ProducerTool.java turn on transacted mode and persisting messages.

> (I have modified source code directly because I couldn't change this parameters through
build.xml. Change is simple.)
> Patch:
> 78,79d77
> <             transacted = true;
> < 
> 88,89d85
> <             persistent = true;
> < 
> 3. Start AMQ $AMQ_HOME/bin/activemq
> 4. Start producer $AMQ_HOME/examples/ant producer -DmessageSize=200000
> 5. Producer will block (on commit method) after approximately 27 messages (which is OK
for selected message size and default max queues size 5Mb)
> 6. Stop producer and AMQ in any order (CTRL-C in terminal)
> 7. Start AMQ  $AMQ_HOME/bin/activemq
> 8. Start producer $AMQ_HOME/examples/ant producer -DmessageSize=200000
> Producer will continue to queue messages infinitely.

-- 
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