Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 500F4200C09 for ; Wed, 25 Jan 2017 16:23:33 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 4EC4B160B50; Wed, 25 Jan 2017 15:23:33 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 98676160B4E for ; Wed, 25 Jan 2017 16:23:32 +0100 (CET) Received: (qmail 17631 invoked by uid 500); 25 Jan 2017 15:23:31 -0000 Mailing-List: contact issues-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 issues@activemq.apache.org Received: (qmail 17622 invoked by uid 99); 25 Jan 2017 15:23:31 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jan 2017 15:23:31 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 53DB7C164A for ; Wed, 25 Jan 2017 15:23:31 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.199 X-Spam-Level: X-Spam-Status: No, score=-1.199 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id iG5JV_vVFIjx for ; Wed, 25 Jan 2017 15:23:30 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 08BB45F2F1 for ; Wed, 25 Jan 2017 15:23:30 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 07640E0312 for ; Wed, 25 Jan 2017 15:23:27 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 8660025288 for ; Wed, 25 Jan 2017 15:23:26 +0000 (UTC) Date: Wed, 25 Jan 2017 15:23:26 +0000 (UTC) From: "Christopher L. Shannon (JIRA)" To: issues@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (AMQ-6579) Expired messages counting as Dispatched on TopicSubscription MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 25 Jan 2017 15:23:33 -0000 [ https://issues.apache.org/jira/browse/AMQ-6579?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Christopher L. Shannon reassigned AMQ-6579: ------------------------------------------- Assignee: Christopher L. Shannon > Expired messages counting as Dispatched on TopicSubscription > ------------------------------------------------------------ > > Key: AMQ-6579 > URL: https://issues.apache.org/jira/browse/AMQ-6579 > Project: ActiveMQ > Issue Type: Bug > Affects Versions: 5.15.0, 5.14.3 > Reporter: Vasco Veloso > Assignee: Christopher L. Shannon > > When a TopicSubscription is configured with a limit on the number of pending messages, it will try to eagerly evict expired messages before dispatching them. > {code:title=TopicSubscription.java:169} > if (!matched.isEmpty() && matched.size() > max) { > removeExpiredMessages(); > } > {code} > When {{TopicSubscription#removeExpiredMessages}} detects an expired message, it will remove it but will increment the counter of dispatched messages as well. > {code:title=TopicSubscription.java:235} > if (node.isExpired()) { > matched.remove(); > getSubscriptionStatistics().getDispatched().increment(); > node.decrementReferenceCount(); > if (broker.isExpired(node)) { > ((Destination) node.getRegionDestination()).getDestinationStatistics().getExpired().increment(); > broker.messageExpired(getContext(), node, this); > } > break; > } > {code} > However this has the side effect of affecting the result of {{getDispatchedQueueSize()}} and therefore {{isFull()}}. These counters will now reflect a new dispatched message that has actually been dropped. > In the worst case scenario slow consumers will no longer receive messages because they are "full" when in fact they have nothing to process. > Am I correct in concluding that expired messages must not count towards the dispatched value? > I have made a quick change, removing the increment, and things look good so far. However I am worried that I may be missing some side effect or specification detail. -- This message was sent by Atlassian JIRA (v6.3.4#6332)