diff options
| author | Alan Conway <aconway@apache.org> | 2012-10-02 18:41:41 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2012-10-02 18:41:41 +0000 |
| commit | 50c802b05c28131017f588048ac845affb216b73 (patch) | |
| tree | c2ea777fc67e88af6bb144b556127d9adf7a5d90 /cpp/src/qpid/broker/Queue.cpp | |
| parent | 2500472b34ae450364ddce715510dcb8c884e555 (diff) | |
| download | qpid-python-50c802b05c28131017f588048ac845affb216b73.tar.gz | |
QPID-4285: HA backups continuously disconnect / re-sync after attempting to replicate a deleted queue. (Based on patch by Jason Dillama)
This does not directly tackle the origin of the problem but extends Jasons's patch since
it addresses something we had to fix anyway: "leaking" queues and exchanges. It does 2 things.
1. enabled hideDeletedError on all subscription objects used by HA
This suppress the troublesome exception with a harmless no-op
2. Delete queues/exchanges missing from responses (based on Jasons patch)
Fix the "leak" of queues and exchanges possible when an object replicated
to a backup is deleted from the newn primary before the backup connects.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1393089 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Queue.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/Queue.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cpp/src/qpid/broker/Queue.cpp b/cpp/src/qpid/broker/Queue.cpp index 276e17a8b5..95cba7bd8e 100644 --- a/cpp/src/qpid/broker/Queue.cpp +++ b/cpp/src/qpid/broker/Queue.cpp @@ -370,7 +370,7 @@ bool Queue::acquire(const QueueCursor& position, const std::string& consumer) bool Queue::getNextMessage(Message& m, Consumer::shared_ptr& c) { - checkNotDeleted(c); + if (!checkNotDeleted(c)) return false; QueueListeners::NotificationSet set; while (true) { //TODO: reduce lock scope @@ -1443,11 +1443,11 @@ QueueListeners& Queue::getListeners() { return listeners; } Messages& Queue::getMessages() { return *messages; } const Messages& Queue::getMessages() const { return *messages; } -void Queue::checkNotDeleted(const Consumer::shared_ptr& c) +bool Queue::checkNotDeleted(const Consumer::shared_ptr& c) { - if (deleted && !c->hideDeletedError()) { + if (deleted && !c->hideDeletedError()) throw ResourceDeletedException(QPID_MSG("Queue " << getName() << " has been deleted.")); - } + return !deleted; } void Queue::addObserver(boost::shared_ptr<QueueObserver> observer) |
