diff --git a/go/vt/vtgate/grpcvtgateconn/conn.go b/go/vt/vtgate/grpcvtgateconn/conn.go index 0fb76dfefe4..a739ed223f1 100644 --- a/go/vt/vtgate/grpcvtgateconn/conn.go +++ b/go/vt/vtgate/grpcvtgateconn/conn.go @@ -38,11 +38,12 @@ import ( ) var ( - cert string - key string - ca string - crl string - name string + cert string + key string + ca string + crl string + name string + failFast bool ) func init() { @@ -65,6 +66,7 @@ func registerFlags(fs *pflag.FlagSet) { fs.StringVar(&ca, "vtgate_grpc_ca", "", "the server ca to use to validate servers when connecting") fs.StringVar(&crl, "vtgate_grpc_crl", "", "the server crl to use to validate server certificates when connecting") fs.StringVar(&name, "vtgate_grpc_server_name", "", "the server name to use to validate server certificate") + fs.BoolVar(&failFast, "vtgate_grpc_fail_fast", false, "whether to enable grpc fail fast when communicating with vtgate") } type vtgateConn struct { @@ -86,7 +88,7 @@ func DialWithOpts(ctx context.Context, opts ...grpc.DialOption) vtgateconn.Diale opts = append(opts, opt) - cc, err := grpcclient.Dial(address, grpcclient.FailFast(false), opts...) + cc, err := grpcclient.Dial(address, grpcclient.FailFast(failFast), opts...) if err != nil { return nil, err }