Skip to content

Commit

Permalink
[buffermgr]: remove the item from consumer queue if invalid (sonic-ne…
Browse files Browse the repository at this point in the history
…t#489)

* [buffermgr]: remove the item from consumer queue if invalid

Signed-off-by: Sihui Han <[email protected]>

* change error to task_invalid_entry

Signed-off-by: Sihui Han <[email protected]>
  • Loading branch information
sihuihan88 authored and lguohan committed Apr 27, 2018
1 parent ea34b92 commit 1f857d5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cfgmgr/buffermgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1f857d5

Please sign in to comment.