Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 75698 invoked from network); 26 Oct 2009 19:17:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Oct 2009 19:17:18 -0000 Received: (qmail 99176 invoked by uid 500); 26 Oct 2009 19:17:18 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 99093 invoked by uid 500); 26 Oct 2009 19:17:18 -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 99083 invoked by uid 99); 26 Oct 2009 19:17:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Oct 2009 19:17:18 +0000 X-ASF-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL,BAYES_00 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; Mon, 26 Oct 2009 19:17:13 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B9635234C045 for ; Mon, 26 Oct 2009 12:16:52 -0700 (PDT) Message-ID: <10081908.1256584612741.JavaMail.jira@brutus> Date: Mon, 26 Oct 2009 12:16:52 -0700 (PDT) From: "Aaron Baff (JIRA)" To: dev@activemq.apache.org Subject: [jira] Created: (AMQ-2465) MessageConsumer.receive(timeout) with prefetchSize=0 results in hang when broker goes down MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c MessageConsumer.receive(timeout) with prefetchSize=3D0 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 I'm doing some testing to verify that I detect and correctly handle when th= e broker goes down while consuming. I came across some strange behavior whe= re the consumers recieve(timeout) call would hang and not throw an exceptio= n 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 wil= l 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 tha= t the sendPullCommand() from ActiveMQMessageConsumer:513 is getting sent, b= ut there is a race condition with the MessageDispatchChannel.dequeue(timeou= t) and the code hitting the mutex.wait() in MessageDispatchChannel:75, whic= h doesn't have a timeout and so the broker never notifies the client that t= here is a message or that it should unblock and the consumers sit there stu= ck.=20 --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.