perf(spanner): use passthrough with emulator endpoint#10947
Merged
Conversation
olavloite
approved these changes
Oct 3, 2024
Contributor
olavloite
left a comment
There was a problem hiding this comment.
LGTM
Side note: Is this something that also affects our tests using the mocked Spanner server? That also just uses a plain-text localhost connection.
This was referenced Oct 8, 2024
bhshkh
added a commit
that referenced
this pull request
Jan 28, 2026
Fixes #10965 This change updates the Bigtable client to use the `passthrough:///` scheme when connecting to the emulator via `BIGTABLE_EMULATOR_HOST`. This ensures consistent behavior with other Google Cloud Go clients (e.g., Spanner #10947) and avoids potential gRPC name resolution issues by forcing the passthrough resolver. It handles `BIGTABLE_EMULATOR_HOST` values with or without an existing scheme (e.g. `localhost:9000` or `http://localhost:9000`).
apstndb
added a commit
to apstndb/spanemuboost
that referenced
this pull request
Mar 7, 2026
…gsValidation Without SPANNER_EMULATOR_HOST set, the Spanner client library doesn't add the passthrough:/// prefix or skip dial settings validation. This causes ~100x slowdown (~1s per client creation) because the new authentication library hits a slow auth path. Since spanemuboost connects via emu.URI() without setting the env var, the fix from googleapis/google-cloud-go#10947 was being bypassed. Add passthrough:/// prefix to endpoint and internaloption.SkipDialSettingsValidation() to both ClientOptions() and defaultClientOpts(). Fixes #7 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4 tasks
apstndb
added a commit
to apstndb/spanemuboost
that referenced
this pull request
Mar 7, 2026
) Without SPANNER_EMULATOR_HOST set, the Spanner client library doesn't add the passthrough:/// prefix or skip dial settings validation. Since spanemuboost connects via emu.URI() without setting the env var, the fix from googleapis/google-cloud-go#10947 is bypassed. Currently the auth layer uses grpc.DialContext (passthrough by default), so this is not actively triggered, but it will regress when the auth layer migrates to grpc.NewClient (dns resolver by default). Changes: - Add passthrough:/// prefix to endpoint in defaultClientOpts() - Add internaloption.SkipDialSettingsValidation() (required by passthrough:///) - Delegate Emulator.ClientOptions() to defaultClientOpts() to avoid duplication - Update test assertion from 3 to 4 options This aligns with the pattern used by Spanner, Bigtable, and Datastore SDKs for their emulator paths. Fixes #7 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #10927