Skip to content

[Spanner] google_default_credentials should probably be async #732

Open
@pjenvey

Description

@pjenvey

When creating/connecting a Spanner client, there's potentially 2 blocking operations required:

  1. Creating/connecting? creds ChannelCredentials::google_default_credentials()
  2. Creating/connecting? a grpc Channel/client ChannelBuilder::secure_connect

One of these is likely a potentially blocking operation, probably 1. as grpc's docs show C#'s google_default_credentials() equivalent as async:

using Grpc.Auth;  // from Grpc.Auth NuGet package
...
// Loads Google Application Default Credentials with publicly trusted roots.
var channelCredentials = await GoogleGrpcCredentials.GetApplicationDefaultAsync();

var channel = new Channel("greeter.googleapis.com", channelCredentials);
var client = new Greeter.GreeterClient(channel);
...

The grpcio lib does not provide async versions of these methods. They may potentially be blocking our async SpannerConnection::connect method, which could be problematic.

We should probably contact Google's grpc client team for advise here and followup with grpc-rs project.

Metadata

Metadata

Assignees

Labels

3Estimate - m - This is a small change, but there's some uncertainty.bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions