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

Fixes #6503
release-3.0
Anthony Romano 2016-10-04 16:09:50 -07:00 committed by Gyu-Ho Lee
parent 1becf9d2f5
commit e853451cd2
1 changed files with 1 additions and 1 deletions

View File

@ -342,7 +342,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)