core: synchronize Stop with concurrent config reloads (#8038)

Signed-off-by: hendrixx-cnc <tjhendrx@icloud.com>
This commit is contained in:
X authored and GitHub committed 2026-09-19 16:02:47 +00:00
1 parent df77f8bde1
commit 128b9e75e0
1 file changed
+4 -6
+4 -6
View File
@@ -692,21 +692,19 @@ type ConfigLoader interface {
// stop the others. Stop should only be called
// if not replacing with a new config.
func Stop() error {
currentCtxMu.RLock()
ctx := currentCtx
currentCtxMu.RUnlock()
rawCfgMu.Lock()
unsyncedStop(ctx)
defer rawCfgMu.Unlock()
currentCtxMu.Lock()
ctx := currentCtx
currentCtx = Context{}
currentCtxMu.Unlock()
unsyncedStop(ctx)
rawCfgJSON = nil
rawCfgIndex = nil
rawCfg[rawConfigKey] = nil
rawCfgMu.Unlock()
return nil
}