From 2e6c5b209d575f73b867de9f3e56b3be4066acec Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Wed, 1 May 2024 15:37:14 -0700 Subject: [PATCH] [DropCounter]Fix the ordering issue with dropcounter (#3128) --- orchagent/debugcounterorch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orchagent/debugcounterorch.cpp b/orchagent/debugcounterorch.cpp index ed27f400d4..882eaaf39b 100644 --- a/orchagent/debugcounterorch.cpp +++ b/orchagent/debugcounterorch.cpp @@ -336,7 +336,6 @@ task_process_status DebugCounterOrch::uninstallDebugCounter(const string& counte string counter_type = counter->getCounterType(); string counter_stat = counter->getDebugCounterSAIStat(); - debug_counters.erase(it); uninstallDebugFlexCounters(counter_type, counter_stat); if (counter_type == PORT_INGRESS_DROPS || counter_type == PORT_EGRESS_DROPS) @@ -347,6 +346,7 @@ task_process_status DebugCounterOrch::uninstallDebugCounter(const string& counte { m_counterNameToSwitchStatMap->hdel("", counter_name); } + debug_counters.erase(it); SWSS_LOG_NOTICE("Successfully deleted drop counter %s", counter_name.c_str()); return task_process_status::task_success;