Skip to content

Commit

Permalink
[Flex-counters] Fix the delay of flex counters flow to prevent infini…
Browse files Browse the repository at this point in the history
…te loop (#1899)

* Fix delay flex counters flow to prevent infinite loop
Signed-off-by: Shlomi Bitton <[email protected]>
  • Loading branch information
shlomibitton authored Sep 9, 2021
1 parent 254bc12 commit 7a0ec8f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions orchagent/flexcounterorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@ void FlexCounterOrch::doTask(Consumer &consumer)

if (op == SET_COMMAND)
{
auto it = std::find(std::begin(data), std::end(data), FieldValueTuple(FLEX_COUNTER_DELAY_STATUS_FIELD, "true"));
auto itDelay = std::find(std::begin(data), std::end(data), FieldValueTuple(FLEX_COUNTER_DELAY_STATUS_FIELD, "true"));

if (it != data.end())
if (itDelay != data.end())
{
consumer.m_toSync.erase(it++);
continue;
}
for (auto valuePair:data)
Expand Down

0 comments on commit 7a0ec8f

Please sign in to comment.