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

grpcproxy: fix deadlock on watch broadcasts stop
This commit is contained in:
Xiang Li
2016-11-18 22:34:35 -08:00
committed by GitHub

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
}