From 8194aa3f03333d099b6b57a571ead092cd0f4553 Mon Sep 17 00:00:00 2001 From: lzhfromustc <43191155+lzhfromustc@users.noreply.github.com> Date: Fri, 28 Jun 2019 11:27:13 -0700 Subject: [PATCH] Fixed a missing block bug Description: w.mu is locked at line 385 and unlocked at line 396. Among 5 return statements in this function, 4 are below line 396 but there is 1 return at line 387. Fix: Add w.mu.Unlock() before that return at line 387. --- clientv3/watch.go | 1 + 1 file changed, 1 insertion(+) diff --git a/clientv3/watch.go b/clientv3/watch.go index d50acbca3..87d222d1d 100644 --- a/clientv3/watch.go +++ b/clientv3/watch.go @@ -384,6 +384,7 @@ func (w *watcher) RequestProgress(ctx context.Context) (err error) { w.mu.Lock() if w.streams == nil { + w.mu.Unlock() return fmt.Errorf("no stream found for context") } wgs := w.streams[ctxKey]