From dev-return-13553-apmail-activemq-dev-archive=activemq.apache.org@activemq.apache.org Tue Nov 25 17:05:57 2008 Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 48121 invoked from network); 25 Nov 2008 17:05:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Nov 2008 17:05:56 -0000 Received: (qmail 38632 invoked by uid 500); 25 Nov 2008 17:06:06 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 38613 invoked by uid 500); 25 Nov 2008 17:06:06 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 38602 invoked by uid 99); 25 Nov 2008 17:06:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Nov 2008 09:06:06 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Nov 2008 17:04:49 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 76A91234C297 for ; Tue, 25 Nov 2008 09:05:05 -0800 (PST) Message-ID: <785696209.1227632705484.JavaMail.jira@brutus> Date: Tue, 25 Nov 2008 09:05:05 -0800 (PST) From: "Dean Thompson (JIRA)" To: dev@activemq.apache.org Subject: [jira] Commented: (AMQ-1992) flow control doesn't work after first restart (if producer works in transacted mode with persistent messages) In-Reply-To: <1863078357.1225528985419.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ 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.