mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44:17 -04:00
plugin/metrcs: fix datarace on listeners (#2835)
This fixes a data race on the listener(s) that get started in the metrics plugins. It also restore pkg/uniq to its former glory and removes and state being carried in there; this means for metrics that registry.go was to replicate that behavior *with* locking (as pkg/uniq doesn't do, or need that). Also renamed uniqAddr to just u, to make it slightly shorter. Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
@@ -24,7 +24,7 @@ func setup(c *caddy.Controller) error {
|
||||
|
||||
rd := &ready{Addr: addr}
|
||||
|
||||
uniqAddr.Set(addr, rd.onStartup, rd)
|
||||
uniqAddr.Set(addr, rd.onStartup)
|
||||
|
||||
c.OncePerServerBlock(func() error {
|
||||
c.OnStartup(func() error {
|
||||
|
||||
Reference in New Issue
Block a user