Skip to content

Commit

Permalink
[intfsorch]: Fix rif flex counter removal error (sonic-net#975)
Browse files Browse the repository at this point in the history
rifFlexCounter hasn't removed when rif removed, syncd runtime error happens.
  • Loading branch information
tylerlinp authored and stcheng committed Jul 16, 2019
1 parent a176f0d commit 05c01e5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions orchagent/intfsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,6 @@ void IntfsOrch::addRifToFlexCounter(const string &id, const string &name, const
}

/* check the state of intf, if registering the intf to FC will result in runtime error */
vector<FieldValueTuple> fvt;
vector<FieldValueTuple> fieldValues;
fieldValues.emplace_back(RIF_COUNTER_ID_LIST, counters_stream.str());

Expand All @@ -839,10 +838,7 @@ void IntfsOrch::removeRifFromFlexCounter(const string &id, const string &name)
/* remove it from FLEX_COUNTER_DB */
string key = getRifFlexCounterTableKey(id);

vector<FieldValueTuple> fieldValues;
fieldValues.emplace_back(RIF_COUNTER_ID_LIST, "");

m_flexCounterTable->set(key, fieldValues);
m_flexCounterTable->del(key);
SWSS_LOG_DEBUG("Unregistered interface %s from Flex counter", name.c_str());
}

Expand Down

0 comments on commit 05c01e5

Please sign in to comment.