Explorar el Código

clientv3: fix watch to reconnect on failure

It was spinning before.
Anthony Romano hace 9 años
padre
commit
267d1cb16f
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      clientv3/watch.go

+ 3 - 0
clientv3/watch.go

@@ -521,6 +521,9 @@ func (w *watcher) openWatchClient() (ws pb.Watch_WatchClient, err error) {
 			return nil, v3rpc.Error(err)
 		}
 		w.rc.release()
+		if nerr := w.rc.reconnectWait(w.ctx, err); nerr != nil {
+			return nil, v3rpc.Error(nerr)
+		}
 	}
 	return ws, nil
 }