From 53ee4e471be78e83b64221d15c12d73006506c3b Mon Sep 17 00:00:00 2001 From: Andy Xie Date: Fri, 1 Nov 2019 21:12:36 +0800 Subject: [PATCH] nsqlookupd: fix RUnlock --- nsqlookupd/registration_db.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nsqlookupd/registration_db.go b/nsqlookupd/registration_db.go index 3f1dd509a..9752596cf 100644 --- a/nsqlookupd/registration_db.go +++ b/nsqlookupd/registration_db.go @@ -189,11 +189,11 @@ func (r *RegistrationDB) FindProducers(category string, key string, subkey strin cachedKey := fmt.Sprintf("%s:%s:%s", category, key, subkey) if val, found := r.cachedFindProducersResults.Get(cachedKey); found { - r.cachedMutex.Unlock() + r.cachedMutex.RUnlock() return val.(Producers) } - r.cachedMutex.Unlock() + r.cachedMutex.RUnlock() r.cachedMutex.Lock() defer r.cachedMutex.Unlock()