summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/Link.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2011-01-18 20:43:41 +0000
committerAlan Conway <aconway@apache.org>2011-01-18 20:43:41 +0000
commitbddb141595d41b11cbd0f56b8da9e4da0d217faa (patch)
treed71771c2cf490b27bf068ef2644f98ced45426d6 /cpp/src/qpid/broker/Link.cpp
parent8ad4e725aa94540c8a1445c6eb08ac12ca83b0df (diff)
downloadqpid-python-bddb141595d41b11cbd0f56b8da9e4da0d217faa.tar.gz
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
Diffstat (limited to 'cpp/src/qpid/broker/Link.cpp')
-rw-r--r--cpp/src/qpid/broker/Link.cpp12
1 files changed, 9 insertions, 3 deletions
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++) {