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 64CD1200C11 for ; Fri, 20 Jan 2017 12:31:37 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 63601160B48; Fri, 20 Jan 2017 11:31:37 +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 ACDE2160B39 for ; Fri, 20 Jan 2017 12:31:36 +0100 (CET) Received: (qmail 34368 invoked by uid 500); 20 Jan 2017 11:31:35 -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 34359 invoked by uid 99); 20 Jan 2017 11:31:35 -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; Fri, 20 Jan 2017 11:31:35 +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 57C2AC0B2E for ; Fri, 20 Jan 2017 11:31:35 +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 Vc7i5RgEfbWH for ; Fri, 20 Jan 2017 11:31:34 +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 C6F3B5FAF3 for ; Fri, 20 Jan 2017 11:31:33 +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 87F87E02D6 for ; Fri, 20 Jan 2017 11:31: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 AEA3C2529D for ; Fri, 20 Jan 2017 11:31:26 +0000 (UTC) Date: Fri, 20 Jan 2017 11:31:26 +0000 (UTC) From: "Christopher L. Shannon (JIRA)" To: issues@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (AMQ-1940) Negative queue size (reproducible) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 20 Jan 2017 11:31:37 -0000 [ https://issues.apache.org/jira/browse/AMQ-1940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15831571#comment-15831571 ] Christopher L. Shannon edited comment on AMQ-1940 at 1/20/17 11:31 AM: ----------------------------------------------------------------------- [~gtully], Thanks for the feedback. I was going to try for option 2a) (and possibly 2b) initially because it seems like some of that work might have already been done over the years to prevent handling acks for messages that don't exist. I will check the ack handling to verify and see what changes are needed. In terms of locking I thought about this but was concerned about it being a bit slow if the purge took a long time. My initial thought was to just grab a write lock on the pagedInMessagesLock for the entire purge() method and release when purge is done. This should prevent new messages from being sent to the Queue. Off the top of my head I don't remember if that is sufficient for preventing dispatch or if we need to grab another lock such as the messages lock or pagedInPendingDispatchLock. was (Author: christopher.l.shannon): [~gtully], Thanks for the feedback. I was going to try for option 2a) (and possibly 2b) at initially because it seems like some of that work might have already been done over the years to prevent handling acks for messages that don't exist. I will check the ack handling to verify and see what changes are needed. In terms of locking I thought about this but was concerned about it being a bit slow if the purge took a long time. My initial thought was to just grab a write lock on the pagedInMessagesLock for the entire purge() method and release when purge is done. This should prevent new messages from being sent to the Queue. Off the top of my head I don't remember if that is sufficient for preventing dispatch or if we need to grab another luck such as the messages lock or pagedInPendingDispatchLock. > Negative queue size (reproducible) > ---------------------------------- > > Key: AMQ-1940 > URL: https://issues.apache.org/jira/browse/AMQ-1940 > Project: ActiveMQ > Issue Type: Bug > Components: Broker > Affects Versions: 5.2.0 > Environment: Found on Windows but reproduced under Linux > Reporter: Vadim Chekan > Assignee: Rob Davies > Priority: Critical > Fix For: 5.3.0 > > Attachments: Main.java, Picture 6.png, QueuePurgeTest.java.diff.txt > > > When you "purge" queue from web admin console, it zeroes queue message > counter. But if you have an active consumer at that time which > pre-fetched messages than your consumer will keep sending ack as it > process messages from its buffer. ActiveMQ will keep decrement counter > upon receiving each ack. So when consumer is done queue will show > MINUS. -- This message was sent by Atlassian JIRA (v6.3.4#6332)