From 265233517e88f2ce37d08815f453f646fad89df4 Mon Sep 17 00:00:00 2001 From: Milos Gajdos Date: Tue, 3 Dec 2019 14:49:24 +0000 Subject: [PATCH] Fix memory registry race --- registry/memory/memory.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/registry/memory/memory.go b/registry/memory/memory.go index 83990377..3d7b782e 100644 --- a/registry/memory/memory.go +++ b/registry/memory/memory.go @@ -87,9 +87,8 @@ func (m *Registry) ttlPrune() { } func (m *Registry) sendEvent(r *registry.Result) { - watchers := make([]*Watcher, 0, len(m.watchers)) - m.RLock() + watchers := make([]*Watcher, 0, len(m.watchers)) for _, w := range m.watchers { watchers = append(watchers, w) }