Skip to content

Commit 89edbca

Browse files
committed
server: remove unused argument, update doc comment
Since ce74d85 the `grpcSrv` argument to `configureGRPCGateway` is not used. The same commit also moved the creation of the loopback listener out of this function making this portion of the documentation potentially misleading.
1 parent a0d41da commit 89edbca

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

pkg/server/grpc_gateway.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@ var _ grpcGatewayServer = authserver.Server(nil)
3939
var _ grpcGatewayServer = (*ts.Server)(nil)
4040

4141
// configureGRPCGateway initializes services necessary for running the
42-
// GRPC Gateway services proxied against the server at `grpcSrv`.
43-
//
44-
// The connection between the reverse proxy provided by grpc-gateway
45-
// and our grpc server uses a loopback-based listener to create
46-
// connections between the two.
42+
// GRPC Gateway services proxied against the server at `grpcAddr`.
4743
//
4844
// The function returns 3 arguments that are necessary to call
4945
// `RegisterGateway` which generated for each of your gRPC services
@@ -53,8 +49,7 @@ func configureGRPCGateway(
5349
ambientCtx log.AmbientContext,
5450
rpcContext *rpc.Context,
5551
stopper *stop.Stopper,
56-
grpcSrv *grpcServer,
57-
GRPCAddr string,
52+
grpcAddr string,
5853
) (*gwruntime.ServeMux, context.Context, *grpc.ClientConn, error) {
5954
jsonpb := &protoutil.JSONPb{
6055
EnumsAsInts: true,
@@ -77,7 +72,7 @@ func configureGRPCGateway(
7772

7873
// Eschew `(*rpc.Context).GRPCDial` to avoid unnecessary moving parts on the
7974
// uniquely in-process connection.
80-
dialOpts, err := rpcContext.GRPCDialOptions(ctx, GRPCAddr, rpcbase.DefaultClass)
75+
dialOpts, err := rpcContext.GRPCDialOptions(ctx, grpcAddr, rpcbase.DefaultClass)
8176
if err != nil {
8277
return nil, nil, nil, err
8378
}
@@ -93,7 +88,7 @@ func configureGRPCGateway(
9388
telemetry.Inc(getServerEndpointCounter(method))
9489
return invoker(ctx, method, req, reply, cc, opts...)
9590
}
96-
conn, err := grpc.DialContext(ctx, GRPCAddr, append(
91+
conn, err := grpc.DialContext(ctx, grpcAddr, append(
9792
dialOpts,
9893
grpc.WithUnaryInterceptor(callCountInterceptor),
9994
)...)

pkg/server/server.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1707,7 +1707,6 @@ func (s *topLevelServer) PreStart(ctx context.Context) error {
17071707
s.cfg.AmbientCtx,
17081708
s.rpcContext,
17091709
s.stopper,
1710-
s.grpc,
17111710
s.cfg.AdvertiseAddr,
17121711
)
17131712
if err != nil {

pkg/server/tenant.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,6 @@ func (s *SQLServerWrapper) PreStart(ctx context.Context) error {
636636
s.sqlServer.cfg.AmbientCtx,
637637
s.rpcContext,
638638
s.stopper,
639-
s.grpc,
640639
s.sqlServer.cfg.AdvertiseAddr,
641640
)
642641
if err != nil {

0 commit comments

Comments
 (0)