From eea7b38b4881afa49290d062dee78680e8c5948a 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 1628672337..0190a40520 100644 --- a/orchagent/orchdaemon.cpp +++ b/orchagent/orchdaemon.cpp @@ -467,6 +467,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; } @@ -480,14 +486,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