mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #6873 from heyitsanthony/proxy-v3-watch-canceled-sync
grpcproxy: fix deadlock on watch broadcasts stop
This commit is contained in:
@@ -116,13 +116,12 @@ func (wbs *watchBroadcasts) empty() bool { return len(wbs.bcasts) == 0 }
|
||||
|
||||
func (wbs *watchBroadcasts) stop() {
|
||||
wbs.mu.Lock()
|
||||
defer wbs.mu.Unlock()
|
||||
|
||||
for wb := range wbs.bcasts {
|
||||
wb.stop()
|
||||
}
|
||||
wbs.bcasts = nil
|
||||
close(wbs.updatec)
|
||||
wbs.mu.Unlock()
|
||||
<-wbs.donec
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user