Merge pull request #7504 from heyitsanthony/fix-watch-wait

clientv3: close open watch channel if substream is closing on reconnect
release-3.2
Anthony Romano 2017-03-15 08:57:14 -07:00 committed by GitHub
commit 7a6b61cd6f
1 changed files with 4 additions and 0 deletions

View File

@ -694,6 +694,10 @@ func (w *watchGrpcStream) waitCancelSubstreams(stopc <-chan struct{}) <-chan str
go func(ws *watcherStream) {
defer wg.Done()
if ws.closing {
if ws.initReq.ctx.Err() != nil && ws.outc != nil {
close(ws.outc)
ws.outc = nil
}
return
}
select {