From 4acfc5608c2330d7b0e980061c06764c2f094d27 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 31 Jul 2012 13:58:36 +0000 Subject: QPID-4176: HA Error handling Fix error handling so that backup brokers shut down on replication errors. Previously replication errors were being thrown to the primary, breaking the replication session. This would put the primary into an endless futile reconnect attempt. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1367554 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/ha/QueueReplicator.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cpp/src/qpid/ha/QueueReplicator.cpp') diff --git a/cpp/src/qpid/ha/QueueReplicator.cpp b/cpp/src/qpid/ha/QueueReplicator.cpp index a55fa00562..be910a087f 100644 --- a/cpp/src/qpid/ha/QueueReplicator.cpp +++ b/cpp/src/qpid/ha/QueueReplicator.cpp @@ -19,6 +19,7 @@ * */ +#include "HaBroker.h" #include "QueueReplicator.h" #include "ReplicatingSubscription.h" #include "qpid/broker/Bridge.h" @@ -58,12 +59,13 @@ bool QueueReplicator::isEventKey(const std::string key) { return ret; } -QueueReplicator::QueueReplicator(const BrokerInfo& info, +QueueReplicator::QueueReplicator(HaBroker& hb, boost::shared_ptr q, boost::shared_ptr l) : Exchange(replicatorName(q->getName()), 0, q->getBroker()), + haBroker(hb), logPrefix("Backup queue "+q->getName()+": "), - queue(q), link(l), brokerInfo(info) + queue(q), link(l), brokerInfo(hb.getBrokerInfo()) { Uuid uuid(true); bridgeName = replicatorName(q->getName()) + std::string(".") + uuid.str(); @@ -183,6 +185,7 @@ void QueueReplicator::route(Deliverable& msg) } catch (const std::exception& e) { QPID_LOG(critical, logPrefix << "Replication failed: " << e.what()); + haBroker.shutdown(); throw; } } -- cgit v1.2.1