From 6a03125a8aeb107bf0969526eec7d8aaa4c75810 Mon Sep 17 00:00:00 2001 From: deepthi Date: Fri, 28 May 2021 13:05:05 -0700 Subject: [PATCH] etcd: add grpc.WithBlock to client config Signed-off-by: deepthi --- go/vt/topo/etcd2topo/server.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/go/vt/topo/etcd2topo/server.go b/go/vt/topo/etcd2topo/server.go index 89c97cc9fef..aeb7c4691ac 100644 --- a/go/vt/topo/etcd2topo/server.go +++ b/go/vt/topo/etcd2topo/server.go @@ -40,6 +40,8 @@ import ( "strings" "time" + "google.golang.org/grpc" + clientv3 "go.etcd.io/etcd/client/v3" "go.etcd.io/etcd/pkg/v3/tlsutil" @@ -116,11 +118,13 @@ func newTLSConfig(certPath, keyPath, caPath string) (*tls.Config, error) { return tlscfg, nil } +// NewServerWithOpts creates a new server with the provided TLS options func NewServerWithOpts(serverAddr, root, certPath, keyPath, caPath string) (*Server, error) { // TODO: Rename this to NewServer and change NewServer to a name that signifies it uses the process-wide TLS settings. config := clientv3.Config{ Endpoints: strings.Split(serverAddr, ","), DialTimeout: 5 * time.Second, + DialOptions: []grpc.DialOption{grpc.WithBlock()}, } tlscfg, err := newTLSConfig(certPath, keyPath, caPath)