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
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; } }
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 ***