Merge pull request #6873 from heyitsanthony/proxy-v3-watch-canceled-sync

grpcproxy: fix deadlock on watch broadcasts stop
release-3.1
Xiang Li 2016-11-18 22:34:35 -08:00 committed by GitHub
commit 7e7c7e157e
1 changed files with 1 additions and 2 deletions

View File

@ -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
}