@@ -17,7 +17,6 @@ import (
1717 "github.com/cockroachdb/cockroach/pkg/rpc"
1818 "github.com/cockroachdb/cockroach/pkg/server"
1919 "github.com/cockroachdb/cockroach/pkg/server/serverpb"
20- "github.com/cockroachdb/cockroach/pkg/util/hlc"
2120 "github.com/cockroachdb/cockroach/pkg/util/netutil/addr"
2221 "github.com/cockroachdb/cockroach/pkg/util/stop"
2322 "github.com/cockroachdb/cockroach/pkg/util/timeutil"
@@ -26,13 +25,11 @@ import (
2625 "google.golang.org/grpc"
2726)
2827
29- // getClientGRPCConn returns a ClientConn, a Clock and a method that blocks
28+ // getClientGRPCConn returns a ClientConn and a method that blocks
3029// until the connection (and its associated goroutines) have terminated.
31- func getClientGRPCConn (
32- ctx context.Context , cfg server.Config ,
33- ) (* grpc.ClientConn , hlc.WallClock , func (), error ) {
30+ func getClientGRPCConn (ctx context.Context , cfg server.Config ) (* grpc.ClientConn , func (), error ) {
3431 if ctx .Done () == nil {
35- return nil , nil , nil , errors .New ("context must be cancellable" )
32+ return nil , nil , errors .New ("context must be cancellable" )
3633 }
3734 // 0 to disable max offset checks; this RPC context is not a member of the
3835 // cluster, so there's no need to enforce that its max offset is the same
@@ -59,14 +56,14 @@ func getClientGRPCConn(
5956 addr , err := addr .AddrWithDefaultLocalhost (cfg .AdvertiseAddr )
6057 if err != nil {
6158 stopper .Stop (ctx )
62- return nil , nil , nil , err
59+ return nil , nil , err
6360 }
6461 // We use GRPCUnvalidatedDial() here because it does not matter
6562 // to which node we're talking to.
6663 conn , err := rpcContext .GRPCUnvalidatedDial (addr ).Connect (ctx )
6764 if err != nil {
6865 stopper .Stop (ctx )
69- return nil , nil , nil , err
66+ return nil , nil , err
7067 }
7168 stopper .AddCloser (stop .CloserFn (func () {
7269 _ = conn .Close () // nolint:grpcconnclose
@@ -76,13 +73,13 @@ func getClientGRPCConn(
7673 closer := func () {
7774 stopper .Stop (ctx )
7875 }
79- return conn , clock , closer , nil
76+ return conn , closer , nil
8077}
8178
8279// getAdminClient returns an AdminClient and a closure that must be invoked
8380// to free associated resources.
8481func getAdminClient (ctx context.Context , cfg server.Config ) (serverpb.AdminClient , func (), error ) {
85- conn , _ , finish , err := getClientGRPCConn (ctx , cfg )
82+ conn , finish , err := getClientGRPCConn (ctx , cfg )
8683 if err != nil {
8784 return nil , nil , errors .Wrap (err , "failed to connect to the node" )
8885 }
@@ -94,7 +91,7 @@ func getAdminClient(ctx context.Context, cfg server.Config) (serverpb.AdminClien
9491func getStatusClient (
9592 ctx context.Context , cfg server.Config ,
9693) (serverpb.StatusClient , func (), error ) {
97- conn , _ , finish , err := getClientGRPCConn (ctx , cfg )
94+ conn , finish , err := getClientGRPCConn (ctx , cfg )
9895 if err != nil {
9996 return nil , nil , errors .Wrap (err , "failed to connect to the node" )
10097 }
0 commit comments