From 186274cf6569af3362093268bd5c4397507d1a73 Mon Sep 17 00:00:00 2001 From: Trekkie Coder Date: Sun, 12 Jan 2025 01:55:00 +0900 Subject: [PATCH] Better signal handling for termination --- pkg/loxinet/loxinet.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/loxinet/loxinet.go b/pkg/loxinet/loxinet.go index 5421c30ce..027e69702 100644 --- a/pkg/loxinet/loxinet.go +++ b/pkg/loxinet/loxinet.go @@ -167,6 +167,9 @@ func loxiNetTicker(bgpPeerMode bool) { pprof.StopCPUProfile() } else if sig == syscall.SIGINT || sig == syscall.SIGTERM { tk.LogIt(tk.LogCritical, "Shutdown on sig %v\n", sig) + if !bgpPeerMode { + mh.dpEbpf.DpEbpfUnInit() + } // TODO - More subsystem cleanup TBD mh.zr.Rules.RuleDestructAll() if mh.cloudHook != nil { @@ -188,9 +191,6 @@ func loxiNetTicker(bgpPeerMode bool) { } } } - if !bgpPeerMode { - mh.dpEbpf.DpEbpfUnInit() - } mh.has.CIDestroy() apiserver.ApiServerShutOk() }