From b51dc5d5d0b8764165170af1f54b77d6de8cb5a1 Mon Sep 17 00:00:00 2001 From: Matt Holt Date: Fri, 21 Jul 2023 15:32:20 -0600 Subject: core: Refine mutex during reloads (fix #5628) (#5645) Separate currentCtxMu to protect currentCtx, and a new rawCfgMu to protect rawCfg and synchronize loads. --- admin.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'admin.go') diff --git a/admin.go b/admin.go index 3ea5051..4a1d23b 100644 --- a/admin.go +++ b/admin.go @@ -1016,9 +1016,9 @@ func handleConfigID(w http.ResponseWriter, r *http.Request) error { id := parts[2] // map the ID to the expanded path - currentCtxMu.RLock() + rawCfgMu.RLock() expanded, ok := rawCfgIndex[id] - currentCtxMu.RUnlock() + rawCfgMu.RUnlock() if !ok { return APIError{ HTTPStatus: http.StatusNotFound, -- cgit v1.2.3