From bddb141595d41b11cbd0f56b8da9e4da0d217faa Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 18 Jan 2011 20:43:41 +0000 Subject: QPID-2982 Bug 669452 - Creating a route and using management tools can crash cluster members. Cluster update did not include federation link and bridge objects. Fixed update to include them. Management linkUp and linkDown events were generated only on the broker receiving the link. Suppressed these events in a cluster. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1060568 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/Link.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'cpp/src/qpid/broker/Link.cpp') diff --git a/cpp/src/qpid/broker/Link.cpp b/cpp/src/qpid/broker/Link.cpp index 5a50d26c8c..e1091df724 100644 --- a/cpp/src/qpid/broker/Link.cpp +++ b/cpp/src/qpid/broker/Link.cpp @@ -30,6 +30,7 @@ #include "qpid/framing/enum.h" #include "qpid/framing/reply_exceptions.h" #include "qpid/broker/AclModule.h" +#include "qpid/sys/ClusterSafe.h" using namespace qpid::broker; using qpid::framing::Buffer; @@ -130,9 +131,12 @@ void Link::established () { stringstream addr; addr << host << ":" << port; - QPID_LOG (info, "Inter-broker link established to " << addr.str()); - agent->raiseEvent(_qmf::EventBrokerLinkUp(addr.str())); + + // Don't raise the management event in a cluster, other members wont't get this call. + if (!sys::isCluster()) + agent->raiseEvent(_qmf::EventBrokerLinkUp(addr.str())); + { Mutex::ScopedLock mutex(lock); setStateLH(STATE_OPERATIONAL); @@ -150,11 +154,13 @@ void Link::closed (int, std::string text) connection = 0; + // Don't raise the management event in a cluster, other members wont't get this call. if (state == STATE_OPERATIONAL) { stringstream addr; addr << host << ":" << port; QPID_LOG (warning, "Inter-broker link disconnected from " << addr.str()); - agent->raiseEvent(_qmf::EventBrokerLinkDown(addr.str())); + if (!sys::isCluster()) + agent->raiseEvent(_qmf::EventBrokerLinkDown(addr.str())); } for (Bridges::iterator i = active.begin(); i != active.end(); i++) { -- cgit v1.2.1