From 75fc96597b688961e2a5ef5b0c170316b2e9afe9 Mon Sep 17 00:00:00 2001 From: Devesh Pathak <54966909+devpatha@users.noreply.github.com> Date: Tue, 26 Jul 2022 08:44:40 -0700 Subject: [PATCH] [DualToR] Handle race condition between tunnel_decap and mux orchestrator (#2397) *Change orch list to make sure mux_orch and mux_cb_orch are placed after tunnel_decap_orch --- orchagent/muxorch.cpp | 3 +-- orchagent/orchdaemon.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/orchagent/muxorch.cpp b/orchagent/muxorch.cpp index c9d4158040be..6770a4defbb5 100644 --- a/orchagent/muxorch.cpp +++ b/orchagent/muxorch.cpp @@ -1280,8 +1280,6 @@ bool MuxOrch::handlePeerSwitch(const Request& request) if (op == SET_COMMAND) { - mux_peer_switch_ = peer_ip; - // Create P2P tunnel when peer_ip is available. IpAddresses dst_ips = decap_orch_->getDstIpAddresses(MUX_TUNNEL); if (!dst_ips.getSize()) @@ -1316,6 +1314,7 @@ bool MuxOrch::handlePeerSwitch(const Request& request) } mux_tunnel_id_ = create_tunnel(&peer_ip, &dst_ip, tc_to_dscp_map_id, tc_to_queue_map_id, dscp_mode_name); + mux_peer_switch_ = peer_ip; SWSS_LOG_NOTICE("Mux peer ip '%s' was added, peer name '%s'", peer_ip.to_string().c_str(), peer_name.c_str()); } diff --git a/orchagent/orchdaemon.cpp b/orchagent/orchdaemon.cpp index d4b40844a8fb..934f1f5d1979 100644 --- a/orchagent/orchdaemon.cpp +++ b/orchagent/orchdaemon.cpp @@ -346,7 +346,7 @@ bool OrchDaemon::init() * when iterating ConsumerMap. This is ensured implicitly by the order of keys in ordered map. * For cases when Orch has to process tables in specific order, like PortsOrch during warm start, it has to override Orch::doTask() */ - m_orchList = { gSwitchOrch, gCrmOrch, gPortsOrch, gBufferOrch, gFlowCounterRouteOrch, mux_orch, mux_cb_orch, gIntfsOrch, gNeighOrch, gNhgMapOrch, gNhgOrch, gCbfNhgOrch, gRouteOrch, gCoppOrch, gQosOrch, wm_orch, gPolicerOrch, tunnel_decap_orch, sflow_orch, gDebugCounterOrch, gMacsecOrch, gBfdOrch, gSrv6Orch}; + m_orchList = { gSwitchOrch, gCrmOrch, gPortsOrch, gBufferOrch, gFlowCounterRouteOrch, gIntfsOrch, gNeighOrch, gNhgMapOrch, gNhgOrch, gCbfNhgOrch, gRouteOrch, gCoppOrch, gQosOrch, wm_orch, gPolicerOrch, tunnel_decap_orch, sflow_orch, gDebugCounterOrch, gMacsecOrch, gBfdOrch, gSrv6Orch, mux_orch, mux_cb_orch}; bool initialize_dtel = false; if (platform == BFN_PLATFORM_SUBSTRING || platform == VS_PLATFORM_SUBSTRING)