clientv3: register waitCancelSubstreams closingc goroutine with waitgroup

Fixes #7598
release-3.2
Anthony Romano 2017-04-05 16:03:03 -07:00
parent 63c6824905
commit aab2eda7df
1 changed files with 5 additions and 1 deletions

View File

@ -711,7 +711,11 @@ func (w *watchGrpcStream) waitCancelSubstreams(stopc <-chan struct{}) <-chan str
ws.closing = true
close(ws.outc)
ws.outc = nil
go func() { w.closingc <- ws }()
w.wg.Add(1)
go func() {
defer w.wg.Done()
w.closingc <- ws
}()
case <-stopc:
}
}(w.resuming[i])