Repository navigation
fix(bigtable): disable connection pooling when emulator is set - #14483
Merged
bhshkh merged 4 commits intoApr 24, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request ensures that the Bigtable connection pool is disabled when the emulator is detected, as it is not supported in that environment. The changes include a new integration test for client initialization with the emulator and comprehensive unit tests for the connection pool enablement logic. The review feedback suggests updating the documentation for the EnableBigtableConnectionPool function to reflect this new behavior and adding a specific test case to confirm that the emulator setting correctly takes precedence over other environment variables.
hongalex
reviewed
Apr 24, 2026
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
bhshkh
enabled auto-merge (squash)
April 24, 2026 20:46
shollyman
approved these changes
Apr 24, 2026
hongalex
approved these changes
Apr 24, 2026
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.
Summary
This PR fixes issue #14480 . The fix automatically disables the custom connection pool whenever the
BIGTABLE_EMULATOR_HOSTenvironment variable is detected.Root Cause
In recent versions (v1.26.0+), the custom Bigtable connection pool is enabled by default for production traffic . However, when
BIGTABLE_EMULATOR_HOSTis set, the client library initializes a single shared*grpc.ClientConn.The custom connection pool expects to manage the lifecycle of multiple unique channels. Because the emulator uses a single pre-dialed connection, the pool's attempt to "prime" or manage multiple internal connections results in conflicts. Specifically, if the pool attempts to close or recycle a connection wrapper, it inadvertently closes the shared underlying gRPC connection for all other members of the pool, leading to errors such as
rpc error: code = Canceled desc = grpc: the client connection is closing.Changes
Modified
google3/third_party/golang/cloud_google_com/go/bigtable/v/v1/internal/option/option.go:EnableBigtableConnectionPoolto check for theBIGTABLE_EMULATOR_HOSTenvironment variable .false, ensuring the client falls back to the standard connection logic.This change automates the current manual workaround of setting
CBT_BIGTABLE_CONN_POOL=falsewhen using the emulator .Fixes: #14480