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.

Change-Id: I7c6a2f38478039e511b3775f27708d9d38111c73
closes-bug: 1542648
  • Loading branch information
haripk committed Feb 24, 2016
1 parent 6c20e9f commit c4541ee
Show file tree
Hide file tree
Showing 6 changed files with 31 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;
}
8 changes: 8 additions & 0 deletions src/ksync/ksync_entry.h
Expand Up @@ -10,6 +10,7 @@
#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, ...)\
Expand All @@ -19,6 +20,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 @@ -498,10 +501,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 @@ -42,13 +42,7 @@ void vr_mem_stats_req::Process(SandeshContext *context) {
int KSyncSandeshContext::VrResponseMsgHandler(vr_response *r) {
response_code_ = r->get_resp_code();

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

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 c4541ee

Please sign in to comment.