diff --git a/balancer/provider/balancer.go b/balancer/provider/balancer.go index 9e5dba2f7..08db930d1 100644 --- a/balancer/provider/balancer.go +++ b/balancer/provider/balancer.go @@ -41,7 +41,7 @@ func NewBalancer() (*BalancerImpl, error) { threshold[i] = configThresholds[i] threshold[metricsCount+i] = configThresholds[i] } - conn, err := grpc.Dial(config.BalancerConfig().CoordinatorAddress, grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.NewClient(config.BalancerConfig().CoordinatorAddress, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { return nil, err } diff --git a/cmd/coordctl/main.go b/cmd/coordctl/main.go index 8b0a7ebc6..18aa4c803 100644 --- a/cmd/coordctl/main.go +++ b/cmd/coordctl/main.go @@ -35,7 +35,7 @@ var ( func DialCoordinator(r *topology.Router) (*grpc.ClientConn, error) { // TODO: add creds, remove WithInsecure - return grpc.Dial(r.Address, grpc.WithInsecure()) //nolint:all + return grpc.NewClient(r.Address, grpc.WithInsecure()) //nolint:all } var rootCmd = &cobra.Command{ diff --git a/coordinator/provider/coordinator.go b/coordinator/provider/coordinator.go index ae0429c40..ea8e945b7 100644 --- a/coordinator/provider/coordinator.go +++ b/coordinator/provider/coordinator.go @@ -173,7 +173,7 @@ func DialRouter(r *topology.Router) (*grpc.ClientConn, error) { Str("router-id", r.ID). Msg("dialing router") // TODO: add creds - return grpc.Dial(r.Address, grpc.WithInsecure()) //nolint:all + return grpc.NewClient(r.Address, grpc.WithInsecure()) //nolint:all } type CoordinatorClient interface { diff --git a/router/console/console.go b/router/console/console.go index dd5e2f024..4c939ec52 100644 --- a/router/console/console.go +++ b/router/console/console.go @@ -95,7 +95,7 @@ func (l *LocalInstanceConsole) proxyProc(ctx context.Context, tstmt spqrparser.S if err != nil { return err } - conn, err := grpc.Dial(coordAddr, grpc.WithInsecure()) //nolint:all + conn, err := grpc.NewClient(coordAddr, grpc.WithInsecure()) //nolint:all if err != nil { return err } @@ -107,7 +107,7 @@ func (l *LocalInstanceConsole) proxyProc(ctx context.Context, tstmt spqrparser.S if err != nil { return err } - conn, err := grpc.Dial(coordAddr, grpc.WithInsecure()) //nolint:all + conn, err := grpc.NewClient(coordAddr, grpc.WithInsecure()) //nolint:all if err != nil { return err } diff --git a/test/feature/spqr_test.go b/test/feature/spqr_test.go index c8c106a59..025cc21d4 100644 --- a/test/feature/spqr_test.go +++ b/test/feature/spqr_test.go @@ -553,10 +553,12 @@ func (tctx *testContext) stepHostIsStopped(service string) error { return false } addr := strings.Split(output, "\n")[1] - conn, err := grpc.Dial(addr, grpc.WithInsecure()) //nolint:all + conn, err := grpc.NewClient(addr, grpc.WithInsecure()) //nolint:all if err != nil { return false } + defer conn.Close() + client := protos.NewRouterServiceClient(conn) ctx, cancel := context.WithTimeout(context.Background(), time.Second) defer cancel()