aboutsummaryrefslogtreecommitdiff
path: root/plugin/pkg/uniq/uniq_test.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2019-05-18 18:34:46 +0100
committerGravatar GitHub <noreply@github.com> 2019-05-18 18:34:46 +0100
commit118b0c940890161d185b64497605a7ef84c38a0a (patch)
treea66511c124afb8c87c16a7784250dc441650e671 /plugin/pkg/uniq/uniq_test.go
parentd41e9ff7b7196374856d8db4bf33b31df8e20abc (diff)
downloadcoredns-118b0c940890161d185b64497605a7ef84c38a0a.tar.gz
coredns-118b0c940890161d185b64497605a7ef84c38a0a.tar.zst
coredns-118b0c940890161d185b64497605a7ef84c38a0a.zip
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>
Diffstat (limited to 'plugin/pkg/uniq/uniq_test.go')
-rw-r--r--plugin/pkg/uniq/uniq_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugin/pkg/uniq/uniq_test.go b/plugin/pkg/uniq/uniq_test.go
index 2093fc7ec..5d58c924b 100644
--- a/plugin/pkg/uniq/uniq_test.go
+++ b/plugin/pkg/uniq/uniq_test.go
@@ -4,7 +4,7 @@ import "testing"
func TestForEach(t *testing.T) {
u, i := New(), 0
- u.Set("test", func() error { i++; return nil }, nil)
+ u.Set("test", func() error { i++; return nil })
u.ForEach()
if i != 1 {