Skip to content

Commit

Permalink
add vtgate_grpc_fail_fast option (#365)
Browse files Browse the repository at this point in the history
Signed-off-by: Esme Lamb <dlamb@slack-corp.com>
  • Loading branch information
demmer authored and dedelala committed Feb 7, 2025
1 parent 9c5cbb8 commit 97e3f85
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions go/vt/vtgate/grpcvtgateconn/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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 {
Expand All @@ -86,7 +88,7 @@ func Dial(opts ...grpc.DialOption) vtgateconn.DialerFunc {

opts = append(opts, opt)

cc, err := grpcclient.DialContext(ctx, address, grpcclient.FailFast(false), opts...)
cc, err := grpcclient.DialContext(ctx, address, grpcclient.FailFast(failFast), opts...)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 97e3f85

Please sign in to comment.