discovery: fix bug that use rlock for read. (#5928)

Signed-off-by: johncming <johncming@yahoo.com>
This commit is contained in:
johncming 2020-01-22 17:57:37 +08:00 committed by Brian Brazil
parent 7d159b2f01
commit 17683d074c
1 changed files with 2 additions and 2 deletions

View File

@ -304,8 +304,8 @@ func (m *Manager) updateGroup(poolKey poolKey, tgs []*targetgroup.Group) {
}
func (m *Manager) allGroups() map[string][]*targetgroup.Group {
m.mtx.Lock()
defer m.mtx.Unlock()
m.mtx.RLock()
defer m.mtx.RUnlock()
tSets := map[string][]*targetgroup.Group{}
for pkey, tsets := range m.targets {