summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2011-02-01 21:25:35 +0000
committerAlan Conway <aconway@apache.org>2011-02-01 21:25:35 +0000
commit080be271bc487183d676afec0c1dc7cc9c71ee2b (patch)
tree0d35081830766cf25324522d8d20ffee6d9126d3 /qpid/cpp/src
parenta4ea204bce86a8cbc5673b3620a165a4ddcc7ce0 (diff)
downloadqpid-python-080be271bc487183d676afec0c1dc7cc9c71ee2b.tar.gz
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@1066215 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/broker/Connection.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/qpid/cpp/src/qpid/broker/Connection.cpp b/qpid/cpp/src/qpid/broker/Connection.cpp
index 680d0c7adf..82761ac7e4 100644
--- a/qpid/cpp/src/qpid/broker/Connection.cpp
+++ b/qpid/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());