Skip to content

Commit

Permalink
Remove unwanted logs.
Browse files Browse the repository at this point in the history
When TCP flows are evicted in vrouter, any further operation from agent
on it results in an error to agent. These expected logs are not
required and can be removed. Also, added a trace buffer for ksync errors.

Conflicts:
	src/ksync/ksync_entry.h
	src/vnsw/agent/vrouter/ksync/sandesh_ksync.cc

(cherry picked from commit c4541ee

Change-Id: I7c6a2f38478039e511b3775f27708d9d38111c73
closes-bug: 1542648
  • Loading branch information
haripk authored and pupapaik committed Feb 25, 2016
1 parent 05f3bc7 commit 669aec3
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 12 deletions.
9 changes: 9 additions & 0 deletions src/ksync/ksync.sandesh
Expand Up @@ -20,3 +20,12 @@ systemlog sandesh VRouterError {
9: string str5;
10: u64 msg_no;
}

/**
* @description: Trace message for KSync Error
* @type: Trace
* @severity: DEBUG
*/
trace sandesh KSyncErrorTrace {
1: string message;
}
9 changes: 9 additions & 0 deletions src/ksync/ksync_entry.h
Expand Up @@ -9,6 +9,8 @@
#include <tbb/atomic.h>
#include <sandesh/common/vns_constants.h>
#include <sandesh/common/vns_types.h>
#include <sandesh/sandesh_trace.h>
#include <db/db_entry.h>

#define KSYNC_ERROR(obj, ...)\
do {\
Expand All @@ -17,6 +19,13 @@ do {\
SandeshLevel::SYS_DEBUG, __FILE__, __LINE__, ##__VA_ARGS__);\
} while (false);\

extern SandeshTraceBufferPtr KSyncErrorTraceBuf;
#define KSYNC_ERROR_TRACE(obj, ...) \
do { \
KSyncError##obj::TraceMsg(KSyncErrorTraceBuf, \
__FILE__, __LINE__, __VA_ARGS__); \
} while (false);

class KSyncObject;
class KSyncDBObject;

Expand Down
14 changes: 10 additions & 4 deletions src/ksync/ksync_object.cc
Expand Up @@ -28,6 +28,9 @@
#include "ksync_object.h"
#include "ksync_types.h"

SandeshTraceBufferPtr KSyncErrorTraceBuf(
SandeshTraceBufferCreate("KSync Error", 5000));

KSyncObject::FwdRefTree KSyncObject::fwd_ref_tree_;
KSyncObject::BackRefTree KSyncObject::back_ref_tree_;
KSyncObjectManager *KSyncObjectManager::singleton_ = NULL;
Expand Down Expand Up @@ -460,10 +463,13 @@ void KSyncEntry::ErrorHandler(int err, uint32_t seq_no) const {
":", error_msg, ">. Object <", ToString(),
">. Operation <", OperationString(), ">. Message number :",
seq_no);
LOG(ERROR, "VRouter operation failed. Error <" << err << ":" <<
error_msg << ">. Object <" << ToString() <<
">. Operation <" << OperationString() << ">. Message number :"
<< seq_no);

std::stringstream sstr;
sstr << "VRouter operation failed. Error <" << err << ":" << error_msg <<
">. Object <" << ToString() << ">. Operation <" <<
OperationString() << ">. Message number :" << seq_no;
KSYNC_ERROR_TRACE(Trace, sstr.str().c_str());
LOG(ERROR, sstr.str().c_str());
KSYNC_ASSERT(err == 0);
}

Expand Down
3 changes: 2 additions & 1 deletion src/vnsw/agent/kstate/kstate.cc
Expand Up @@ -47,7 +47,8 @@ int KState::VrResponseMsgHandler(vr_response *r) {
resp->Response();

st->Release();
LOG(ERROR, "Error: " << strerror(-code) << " :code: " << -code);
LOG(ERROR, "Error reading kstate: " << strerror(-code) <<
" :code: " << -code);
return -code;
}

Expand Down
6 changes: 0 additions & 6 deletions src/vnsw/agent/vrouter/ksync/sandesh_ksync.cc
Expand Up @@ -37,13 +37,7 @@ void vrouter_ops::Process(SandeshContext *context) {
int KSyncSandeshContext::VrResponseMsgHandler(vr_response *r) {
response_code_ = r->get_resp_code();

if (-response_code_ == EEXIST) {
return 0;
}

if (response_code_ < 0) {
LOG(ERROR, "VrResponseMsg Error: " <<
KSyncEntry::VrouterErrorToString(-response_code_));
return -response_code_;
}

Expand Down
Expand Up @@ -37,7 +37,8 @@ int AgentStatsSandeshContext::VrResponseMsgHandler(vr_response *r) {
}

if (code < 0) {
LOG(ERROR, "Error: " << KSyncEntry::VrouterErrorToString(-code));
LOG(ERROR, "Error in reading Statistics from vrouter: " <<
KSyncEntry::VrouterErrorToString(-code));
return -code;
}

Expand Down

0 comments on commit 669aec3

Please sign in to comment.