Browse Source

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

Fixes #6503
Anthony Romano 9 years ago
parent
commit
e285f599e2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      clientv3/watch.go

+ 1 - 1
clientv3/watch.go

@@ -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)