activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher L. Shannon (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (AMQ-1940) Negative queue size (reproducible)
Date Fri, 20 Jan 2017 11:31:26 GMT

    [ 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<consumer buffer size>.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message