diff options
| author | Alan Conway <aconway@apache.org> | 2012-06-12 21:20:27 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2012-06-12 21:20:27 +0000 |
| commit | 9bc4901f70f8f77b78cb80c33d126b95cd709ccc (patch) | |
| tree | 228a9abcf3c949bc3bcf25cb16e42887376ac0a9 /cpp/src/qpid/ha/QueueGuard.cpp | |
| parent | 68ec17cbe42066fae4f4ebdec810a922794d2701 (diff) | |
| download | qpid-python-9bc4901f70f8f77b78cb80c33d126b95cd709ccc.tar.gz | |
QPID-3603: Guard should not complete messages from the internal event queue.
ReplicatingSubscription::acknowledge was calling Guard::complete for messages on the
internal event queue as well as the replicated queue. Corrected to only complete
messages from the replicated queue.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1349542 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/ha/QueueGuard.cpp')
| -rw-r--r-- | cpp/src/qpid/ha/QueueGuard.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cpp/src/qpid/ha/QueueGuard.cpp b/cpp/src/qpid/ha/QueueGuard.cpp index 5ea4c8e6f8..b330c4b9cc 100644 --- a/cpp/src/qpid/ha/QueueGuard.cpp +++ b/cpp/src/qpid/ha/QueueGuard.cpp @@ -61,6 +61,7 @@ QueueGuard::QueueGuard(broker::Queue& q, const BrokerInfo& info) QueueGuard::~QueueGuard() { cancel(); } void QueueGuard::enqueued(const QueuedMessage& qm) { + assert(qm.queue == &queue); // Delay completion QPID_LOG(trace, logPrefix << "Delaying completion of " << qm); qm.payload->getIngressCompletion().startCompleter(); @@ -74,6 +75,7 @@ void QueueGuard::enqueued(const QueuedMessage& qm) { // FIXME aconway 2012-06-05: ERROR, must call on ReplicatingSubscription void QueueGuard::dequeued(const QueuedMessage& qm) { + assert(qm.queue == &queue); QPID_LOG(trace, logPrefix << "Dequeued " << qm); ReplicatingSubscription* rs = 0; { @@ -98,17 +100,19 @@ void QueueGuard::attach(ReplicatingSubscription& rs) { } void QueueGuard::complete(const QueuedMessage& qm, sys::Mutex::ScopedLock&) { - QPID_LOG(trace, logPrefix << "Completed " << qm); + assert(qm.queue == &queue); // The same message can be completed twice, by acknowledged and // dequeued, remove it from the set so we only call // finishCompleter() once if (delayed.contains(qm.position)) { + QPID_LOG(trace, logPrefix << "Completed " << qm); qm.payload->getIngressCompletion().finishCompleter(); delayed -= qm.position; } } void QueueGuard::complete(const QueuedMessage& qm) { + assert(qm.queue == &queue); Mutex::ScopedLock l(lock); complete(qm, l); } |
