Skip to content

Commit

Permalink
[orchagent]: Periodically check all m_toSync map in each while iterat…
Browse files Browse the repository at this point in the history
…ion (sonic-net#220)

If it is checked only in TIMEOUT case, the blocked tasks will not be processed
if there are continuous incoming messages.
  • Loading branch information
Shuotian Cheng authored May 19, 2017
1 parent f5f6f67 commit 3d234e4
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions orchagent/orchdaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,6 @@ void OrchDaemon::start()

if (ret == Select::TIMEOUT)
{
/* After every TIMEOUT, periodically check all m_toSync map to
* execute all the remaining tasks that need to be retried. */
for (Orch *o : m_orchList)
o->doTask();

/* Let sairedis to flush all SAI function call to ASIC DB.
* Normally the redis pipeline will flush when enough request
* accumulated. Still it is possible that small amount of
Expand All @@ -140,6 +135,14 @@ void OrchDaemon::start()

Orch *o = getOrchByConsumer((ConsumerStateTable *)s);
o->execute(((ConsumerStateTable *)s)->getTableName());

/* After each iteration, periodically check all m_toSync map to
* execute all the remaining tasks that need to be retried. */

/* TODO: Abstract Orch class to have a specific todo list */
for (Orch *o : m_orchList)
o->doTask();

}
}

Expand Down

0 comments on commit 3d234e4

Please sign in to comment.