@marcel91200 / caddy Mirror · read-only / commits / 128b9e75
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 11, 04:45 UTC

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

Signed-off-by: hendrixx-cnc <tjhendrx@icloud.com>

X committed Sep 19, 2026 at 09:02 UTC 128b9e75e0f30e853cb20c9a97ce06f9c9fe90a6
1 file changed +4 -6
caddy.go
+4 -6
@@ -692,21 +692,19 @@ type ConfigLoader interface {
692 // stop the others. Stop should only be called
693 // if not replacing with a new config.
694 func Stop() error {
695 - currentCtxMu.RLock()
696 - ctx := currentCtx
697 - currentCtxMu.RUnlock()
698 -
695 rawCfgMu.Lock()
700 - unsyncedStop(ctx)
696 + defer rawCfgMu.Unlock()
697
698 currentCtxMu.Lock()
699 + ctx := currentCtx
700 currentCtx = Context{}
701 currentCtxMu.Unlock()
702
703 + unsyncedStop(ctx)
704 +
705 rawCfgJSON = nil
706 rawCfgIndex = nil
707 rawCfg[rawConfigKey] = nil
709 - rawCfgMu.Unlock()
708
709 return nil
710 }