summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2016-03-17 14:47:32 +0000
committerAlan Conway <aconway@apache.org>2016-03-17 14:47:32 +0000
commit006496cf708639db842f37941c40f7d452789509 (patch)
tree2fa487c0064db5515f7b42c6a9d1c0c7f4422d26
parent37a0b662b1f045c64a315ebffeb6a4b01c111128 (diff)
downloadqpid-python-006496cf708639db842f37941c40f7d452789509.tar.gz
Bug 1318180 - HA memory leak in primary broker when overwriting messages in a ring queue
ReplicatingSubscription accumulates IDs of dequeued messages to send on dispatch. It should clear the accumulated IDs once sent. Due to a merge error, since: 014f0f3 QPID-4327: HA TX transactions: basic replication. The ID set is not cleared, causing it to accumulate memory slowly. This leak would be particularly noticeable on a busy ring-queue since a ring-queue generates a dequeue event for every enqueue once it reaches its max size. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1735439 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/qpid/ha/ReplicatingSubscription.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/qpid/cpp/src/qpid/ha/ReplicatingSubscription.cpp b/qpid/cpp/src/qpid/ha/ReplicatingSubscription.cpp
index fb4cdd014c..8530413b35 100644
--- a/qpid/cpp/src/qpid/ha/ReplicatingSubscription.cpp
+++ b/qpid/cpp/src/qpid/ha/ReplicatingSubscription.cpp
@@ -270,10 +270,11 @@ void ReplicatingSubscription::acknowledged(const broker::DeliveryRecord& r) {
// Called with lock held. Called in subscription's connection thread.
void ReplicatingSubscription::sendDequeueEvent(Mutex::ScopedLock& l)
{
- ReplicationIdSet oldDequeues = dequeues;
if (dequeues.empty()) return;
QPID_LOG(trace, logPrefix << "Sending dequeues " << dequeues);
- sendEvent(DequeueEvent(dequeues), l);
+ DequeueEvent d(dequeues);
+ dequeues.clear();
+ sendEvent(d, l);
}
// Called after the message has been removed