From 9e8968646d02c948cfcff2643d5303355bb5fda3 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 1 Feb 2011 21:25:35 +0000 Subject: QPID-3007: Don't record management statistics in cluster-unsafe contexts. A few frames are sent in cluster-unsafe contexts, e.g. heartbeat timer callbacks and during initial connection negotiation. Don't update the connection's management counters in these contexts to avoid inconsistent management data in a cluster. There are very few such frames so this does not unduly distort the management data. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1066215 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/Connection.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cpp/src') diff --git a/cpp/src/qpid/broker/Connection.cpp b/cpp/src/qpid/broker/Connection.cpp index 680d0c7adf..82761ac7e4 100644 --- a/cpp/src/qpid/broker/Connection.cpp +++ b/cpp/src/qpid/broker/Connection.cpp @@ -184,7 +184,8 @@ bool isMessage(const AMQMethodBody* method) void Connection::recordFromServer(const framing::AMQFrame& frame) { - if (mgmtObject != 0) + // Don't record management stats in cluster-unsafe contexts + if (mgmtObject != 0 && isClusterSafe()) { mgmtObject->inc_framesToClient(); mgmtObject->inc_bytesToClient(frame.encodedSize()); @@ -196,7 +197,8 @@ void Connection::recordFromServer(const framing::AMQFrame& frame) void Connection::recordFromClient(const framing::AMQFrame& frame) { - if (mgmtObject != 0) + // Don't record management stats in cluster-unsafe contexts + if (mgmtObject != 0 && isClusterSafe()) { mgmtObject->inc_framesFromClient(); mgmtObject->inc_bytesFromClient(frame.encodedSize()); -- cgit v1.2.1