Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8BA3810623 for ; Wed, 2 Oct 2013 23:29:44 +0000 (UTC) Received: (qmail 5750 invoked by uid 500); 2 Oct 2013 23:29:43 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 5715 invoked by uid 500); 2 Oct 2013 23:29:43 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 5707 invoked by uid 99); 2 Oct 2013 23:29:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Oct 2013 23:29:43 +0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: 216.139.250.139 is neither permitted nor denied by domain of jw@yahoo-inc.com) Received: from [216.139.250.139] (HELO joe.nabble.com) (216.139.250.139) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Oct 2013 23:29:39 +0000 Received: from [192.168.236.139] (helo=joe.nabble.com) by joe.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1VRVqf-00049l-KJ for users@activemq.apache.org; Wed, 02 Oct 2013 16:28:53 -0700 Date: Wed, 2 Oct 2013 16:28:38 -0700 (PDT) From: Jake Choi To: users@activemq.apache.org Message-ID: <1380756516201-4672195.post@n4.nabble.com> Subject: pendingLock in PrefetchSubscription MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org There's the per-durable-subscription lock called "pendingLock" inside the PrefetchSubscription and PrefetchSubscription#dispatchPending method grabs this mutex for message dispatching. In the ActiveMQ 5.7 that we use, there are 3 requests calling this #dispatchPending as follows: PrefetchSubscription#dispatchPending <- PrefetchSubscription#add PrefetchSubscription#dispatchPending <- PrefetchSubscription#acknowledge PrefetchSubscription#dispatchPending <- DurableTopicSubscription#activate Because both #add (from Topic#send) and #acknowledge do the dispatch and compete with this "pendingLock" mutex, if a durable subscriber becomes busy doing huge dispatching (or huge expiration purging), Topic#send gets blocked and client will get unacceptable publishing latency. I wonder why publishing needs to be blocked by consuming in this way. Isn't there any way we can decouple the send request from the dispatching completely? asyncDispatch=true option doesn't really help at all, since that decouples only the transport part (from "dispatched" collection to client host) but not the actual paging-in part (from "pending" cursor to "dispatched" collection). Thanks, Jake -- View this message in context: http://activemq.2283324.n4.nabble.com/pendingLock-in-PrefetchSubscription-tp4672195.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.