diff options
author | Alan Conway <aconway@apache.org> | 2011-02-01 21:25:35 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2011-02-01 21:25:35 +0000 |
commit | 9e8968646d02c948cfcff2643d5303355bb5fda3 (patch) | |
tree | e3c2162d0a17484dd9c01cce79a0d80341c450a3 /cpp | |
parent | 395cbc7a384021281cdd4c13258258d9c0435eaf (diff) | |
download | qpid-python-9e8968646d02c948cfcff2643d5303355bb5fda3.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/qpid@1066215 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/qpid/broker/Connection.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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()); |