Skip to content

Commit

Permalink
fix(auth): restore use of grpc.Dial
Browse files Browse the repository at this point in the history
There have been a couple of reports lately around some subtle
changes in behaviour of using the new recommend method. There is
also a known bug, see grpc/grpc-go#7556.
Until the bug is fixed and we have a way forward we will revert to
calling the deprecated Dial function.

Fixes: googleapis#7556
  • Loading branch information
codyoss committed Nov 12, 2024
1 parent 36c1280 commit 617c3f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion auth/grpctransport/grpctransport.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ func dial(ctx context.Context, secure bool, opts *Options) (*grpc.ClientConn, er
grpcOpts = addOpenTelemetryStatsHandler(grpcOpts, opts)
grpcOpts = append(grpcOpts, opts.GRPCDialOpts...)

return grpc.NewClient(endpoint, grpcOpts...)
return grpc.Dial(endpoint, grpcOpts...)
}

// grpcKeyProvider satisfies https://pkg.go.dev/google.golang.org/grpc/credentials#PerRPCCredentials.
Expand Down
2 changes: 1 addition & 1 deletion auth/grpctransport/pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestClose(t *testing.T) {

pool := &roundRobinConnPool{}
for i := 0; i < 4; i++ {
conn, err := grpc.NewClient(l.Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.Dial(l.Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit 617c3f1

Please sign in to comment.