diff options
| author | Alan Conway <aconway@apache.org> | 2012-07-31 13:58:36 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2012-07-31 13:58:36 +0000 |
| commit | 4acfc5608c2330d7b0e980061c06764c2f094d27 (patch) | |
| tree | 5fe90a33456a79a29bc3163abf844ae1e96ddde2 /cpp/src/qpid/ha/QueueReplicator.cpp | |
| parent | 71a433fa900fc729a53e92e24fd55b57391968dd (diff) | |
| download | qpid-python-4acfc5608c2330d7b0e980061c06764c2f094d27.tar.gz | |
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
Diffstat (limited to 'cpp/src/qpid/ha/QueueReplicator.cpp')
| -rw-r--r-- | cpp/src/qpid/ha/QueueReplicator.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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<Queue> q, boost::shared_ptr<Link> 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; } } |
