From b9084a720d41daf1d717bcbe06f56e7a95111fa6 Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Wed, 4 Nov 2020 21:29:25 -0800 Subject: [PATCH] Revert: swss: flush g_asicState after each event is done #570 (#1478) **What I did** Revert https://github.com/Azure/sonic-swss/pull/570 We should only `flush` the orchagent/syncd communication channel when there is no active tasks in orchagent. This will not influence the end-to-end performance in long run but introduce SELECT_TIMEOUT (1 s) latency if there is remaining data left inside the orchagent/syncd communication channel after previous `flush`, which is not a big deal. Fix Azure/sonic-buildimage#5570 --- orchagent/orchdaemon.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/orchagent/orchdaemon.cpp b/orchagent/orchdaemon.cpp index 2a06c5595234..eec6a6bd0bd3 100644 --- a/orchagent/orchdaemon.cpp +++ b/orchagent/orchdaemon.cpp @@ -466,6 +466,12 @@ void OrchDaemon::start() if (ret == Select::TIMEOUT) { + /* 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 + * requests live in it. When the daemon has nothing to do, it + * is a good chance to flush the pipeline */ + flush(); continue; } @@ -479,14 +485,6 @@ void OrchDaemon::start() 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 - * requests live in it. When the daemon has finished events/tasks, it - * is a good chance to flush the pipeline before next select happened. - */ - flush(); - /* * Asked to check warm restart readiness. * Not doing this under Select::TIMEOUT condition because of