From bfe9d944fec21c76fb6abb73dfd62efe64a90810 Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Tue, 4 Apr 2023 16:23:00 -0700 Subject: [PATCH] Delay mux/sflow/snmp timer after interface-config service (#14506) Why I did it All these 3 services started after swss service, which used to start after interface-config service. But #13084 remove the time constraints for swss. After that, these 3 services has the chance of start earlier when the inteface-config service is restarting the networking service, which could cause db connect request to fail. How I did it Delay mux/sflow/snmp timer after the interface-config service. How to verify it PR test. Config reload can repro the issue in 1-3 retries. With this change. config reload run 30+ iterations without hitting the issue. Signed-off-by: Ying Xie --- files/build_templates/mux.service.j2 | 2 +- files/build_templates/sflow.service.j2 | 2 +- files/build_templates/snmp.timer | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/files/build_templates/mux.service.j2 b/files/build_templates/mux.service.j2 index ee1f8ce75389..dbb65ac9eb2b 100644 --- a/files/build_templates/mux.service.j2 +++ b/files/build_templates/mux.service.j2 @@ -1,7 +1,7 @@ [Unit] Description=MUX Cable Container Requires=database.service updategraph.service swss.service -After=swss.service +After=swss.service interfaces-config.service BindsTo=sonic.target After=sonic.target StartLimitIntervalSec=1200 diff --git a/files/build_templates/sflow.service.j2 b/files/build_templates/sflow.service.j2 index 9a734742ed0e..fd366fa9d6d9 100644 --- a/files/build_templates/sflow.service.j2 +++ b/files/build_templates/sflow.service.j2 @@ -1,7 +1,7 @@ [Unit] Description=sFlow container Requisite=swss.service -After=swss.service syncd.service hostcfgd.service +After=swss.service syncd.service hostcfgd.service interfaces-config.service BindsTo=sonic.target After=sonic.target Before=ntp-config.service diff --git a/files/build_templates/snmp.timer b/files/build_templates/snmp.timer index 0d17391a73f6..bcbe4963adc4 100644 --- a/files/build_templates/snmp.timer +++ b/files/build_templates/snmp.timer @@ -1,7 +1,7 @@ [Unit] Description=Delays snmp container until SONiC has started PartOf=snmp.service -After=swss.service +After=swss.service interfaces-config.service [Timer] OnUnitActiveSec=0 sec