From 1f857d586c75bdebaf5a5b102f3cb75edd523431 Mon Sep 17 00:00:00 2001 From: sihuihan88 Date: Wed, 25 Apr 2018 22:24:17 -0700 Subject: [PATCH] [buffermgr]: remove the item from consumer queue if invalid (#489) * [buffermgr]: remove the item from consumer queue if invalid Signed-off-by: Sihui Han * change error to task_invalid_entry Signed-off-by: Sihui Han --- cfgmgr/buffermgr.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cfgmgr/buffermgr.cpp b/cfgmgr/buffermgr.cpp index eda11819892d..526dad2b609c 100644 --- a/cfgmgr/buffermgr.cpp +++ b/cfgmgr/buffermgr.cpp @@ -126,7 +126,7 @@ task_process_status BufferMgr::doSpeedUpdateTask(string port, string speed) { SWSS_LOG_ERROR("Unable to create/update PG profile for port %s. No PG profile configured for speed %s and cable length %s", port.c_str(), speed.c_str(), cable.c_str()); - return task_process_status::task_failed; + return task_process_status::task_invalid_entry; } // Crete record in BUFFER_PROFILE table @@ -222,6 +222,10 @@ void BufferMgr::doTask(Consumer &consumer) SWSS_LOG_INFO("Unable to process table update. Will retry..."); ++it; break; + case task_process_status::task_invalid_entry: + SWSS_LOG_ERROR("Failed to process invalid entry, drop it"); + it = consumer.m_toSync.erase(it); + break; default: it = consumer.m_toSync.erase(it); break;