Skip to content

Commit 7a0ec8f

Browse files
authored
[Flex-counters] Fix the delay of flex counters flow to prevent infinite loop (#1899)
* Fix delay flex counters flow to prevent infinite loop Signed-off-by: Shlomi Bitton <[email protected]>
1 parent 254bc12 commit 7a0ec8f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

orchagent/flexcounterorch.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,11 @@ void FlexCounterOrch::doTask(Consumer &consumer)
8686

8787
if (op == SET_COMMAND)
8888
{
89-
auto it = std::find(std::begin(data), std::end(data), FieldValueTuple(FLEX_COUNTER_DELAY_STATUS_FIELD, "true"));
89+
auto itDelay = std::find(std::begin(data), std::end(data), FieldValueTuple(FLEX_COUNTER_DELAY_STATUS_FIELD, "true"));
9090

91-
if (it != data.end())
91+
if (itDelay != data.end())
9292
{
93+
consumer.m_toSync.erase(it++);
9394
continue;
9495
}
9596
for (auto valuePair:data)

0 commit comments

Comments
 (0)