From 415e2d011a75374ad5757ff5b4d262228d143eb4 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Thu, 7 Feb 2013 19:25:53 +0000 Subject: QPID-4555: HA Don't shut down on deleting an exchange that is in use as an alternate. Previously threw an exception in this case which shut down the broker. Log warning instead, this is not a fatal event. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1443676 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/ha/BrokerReplicator.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'qpid/cpp/src') diff --git a/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp b/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp index 9ab6628e17..0f4c5b2be8 100644 --- a/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp +++ b/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp @@ -784,6 +784,15 @@ void BrokerReplicator::deleteQueue(const std::string& name, bool purge) { void BrokerReplicator::deleteExchange(const std::string& name) { try { + boost::shared_ptr exchange = exchanges.find(name); + if (!exchange) { + QPID_LOG(warning, logPrefix << "Cannot delete exchange, not found: " << name); + return; + } + if (exchange->inUseAsAlternate()) { + QPID_LOG(warning, "Cannot delete exchange, in use as alternate: " << name); + return; + } broker.deleteExchange(name, userId, remoteHost); QPID_LOG(debug, logPrefix << "Exchange deleted: " << name); } catch (const framing::NotFoundException&) { -- cgit v1.2.1