clientv3: only return closing error to watcher if context is not canceled

Fixes #6503
This commit is contained in:
Anthony Romano 2016-10-04 16:09:50 -07:00
parent 8e1c989ec3
commit e285f599e2

View File

@ -364,7 +364,7 @@ func (w *watchGrpcStream) closeSubstream(ws *watcherStream) {
default:
}
// close subscriber's channel
if closeErr := w.closeErr; closeErr != nil {
if closeErr := w.closeErr; closeErr != nil && ws.initReq.ctx.Err() == nil {
go w.sendCloseSubstream(ws, &WatchResponse{closeErr: w.closeErr})
} else {
close(ws.outc)