Bug 1136029 - QMF queue depth not dropped for priority queues in one scenario
Summary: QMF queue depth not dropped for priority queues in one scenario
Keywords:
Status: CLOSED DUPLICATE of bug 1136294
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: 2.5
Hardware: All
OS: All
medium
medium
Target Milestone: ---
: ---
Assignee: messaging-bugs
QA Contact: Messaging QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-01 13:25 UTC by Pavel Moravec
Modified: 2018-12-09 18:28 UTC (History)
2 users (show)

Fixed In Version: qpid-cpp-0.18-31
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-03 17:50:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Pavel Moravec 2014-09-01 13:25:11 UTC
Description of problem:
When killing a consumer that moves one message after another from one priority queue to another, queue depth reported by QMF grows despite the queues are even empty. See reproducer for details.


Version-Release number of selected component (if applicable):
0.18-30


How reproducible:
100%


Steps to Reproduce:
(qpid-route is attached, purge_queue is simple program calling purge method for the given queue - see e.g. https://access.redhat.com/site/solutions/70456 or ask me for src.code if required)

rm -rf /var/lib/qpidd/*
service qpidd restart

for q in FirstQ SecondQ; do
	qpid-config add queue $q --argument x-qpid-priorities=10
done

while true; do
	qpid-send -a FirstQ -m 2000 --content-size=2000
	./qpid-route &
	pid=$!
	sleep $(($((RANDOM))%10))
	kill -9 $pid
	for q in FirstQ SecondQ; do
		./purge_queue $q 0 > /dev/null 2>&1 &
	done
	wait
	qpid-stat -q
done


Actual results:
qpid-stat shows queue depth of both FirstQ and SecondQ be growing, despite the queues are purged before qpid-stat run.


Expected results:
qpid-stat shows zero queues depth


Additional info:
priority queues are essential for the reproducer. For normal queues, queue depth is zero as expected

Comment 1 Pavel Moravec 2014-09-01 13:25:46 UTC
qpid-route.cpp:

#include <qpid/messaging/Address.h>
#include <qpid/messaging/Connection.h>
#include <qpid/messaging/Message.h>
#include <qpid/messaging/Receiver.h>
#include <qpid/messaging/Sender.h>
#include <qpid/messaging/Session.h>
#include <iostream>


using namespace qpid::messaging;

int main(int argc, char** argv) {
    
    std::string broker =  "localhost:5672";
    std::string connectionOptions = "";
    
    
    const std::string FirstQ ("FirstQ");
    const std::string SecondQ ("SecondQ");

    Connection connection(broker, connectionOptions);
    try {
        connection.open();
        Session session = connection.createSession();
        
        int64_t count = 1;

     while (true) 
     {
        Receiver receiver1 = session.createReceiver(FirstQ);
        Sender sender1 = session.createSender(SecondQ);
        std::cout << "Sending from " << FirstQ << " to " << SecondQ << std::endl;
        Message message;
        while (receiver1.fetch(message, Duration::SECOND * 1))
          sender1.send(message);

        session.acknowledge();
        std::cout << "------------------------- End Round " << count++ << " --------------------------" << std::endl;
     } //End while
     connection.close();
     return 0;
    } catch(const std::exception& error) {
        std::cerr << error.what() << std::endl;
        connection.close();
        return 1;
    }
}

Comment 2 Pavel Moravec 2014-09-03 17:50:34 UTC
This is just a side effect bug of bz1136294. Again, as queue policy is not updated (as explained in https://bugzilla.redhat.com/show_bug.cgi?id=1136294#c2), dequeue counter is not incremented (that is done in queue policy call that is skipped due to the bug). queue depth is simply calculated as #enqueues - #dequeues.

/me saw proper counters during mine verification of bz1136294.

*** This bug has been marked as a duplicate of bug 1136294 ***


Note You need to log in before you can comment on or make changes to this bug.