feat(bigtable): enable bigtable conn pool by default#14319
Merged
mutianf merged 3 commits intogoogleapis:mainfrom Apr 9, 2026
Merged
feat(bigtable): enable bigtable conn pool by default#14319mutianf merged 3 commits intogoogleapis:mainfrom
mutianf merged 3 commits intogoogleapis:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the EnableBigtableConnectionPool function to enable the connection pool by default if the environment variable is unset or invalid. The feedback recommends clarifying the code comments to explicitly state the fallback behavior when environment variable parsing fails.
Comment on lines
+202
to
+203
| // just fail and use bigtable conn pool | ||
| return true |
Contributor
There was a problem hiding this comment.
The comment 'just fail' is ambiguous. When implementing logic that parses strings, include clear error handling for parsing failures. It is clearer to state that the code is falling back to the default behavior when parsing fails.
Suggested change
| // just fail and use bigtable conn pool | |
| return true | |
| // If the environment variable value is invalid, default to enabling the pool. | |
| return true |
References
- When implementing helper functions that parse strings, always use the provided string parameter and include error handling for parsing failures. For test helpers, panic can be used for unrecoverable parsing errors.
nimf
approved these changes
Apr 8, 2026
When a custom `grpc.ClientConn` is provided via `option.WithGRPCConn`, the `BigtableChannelPool` was still being used by default. This caused the pool to attempt to prime the shared connection multiple times and incorrectly close it if direct access checks or priming failed, leading to "the client connection is closing" errors in subsequent operations. This change disables the `BigtableChannelPool` when `option.WithGRPCConn` is detected in the client options, falling back to standard gRPC connection pool behavior since multi-connection features do not apply to a single provided connection.
…pool
The TestRetryOptionSelection test initializes a Client configuration but does not use a real server or mock connection that handles PingAndWarm. With the Bigtable Connection Pool enabled by default, this test was failing with PermissionDenied errors because it tried to prime a connection to the production Bigtable service ("projects/test-project/instances/test-instance").
This change sets the CBT_BIGTABLE_CONN_POOL environment variable to "false" for this test, disabling the pool and its priming logic, allowing the test to verify retry option logic without requiring a live connection.
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.
Can be disabled via CBT_BIGTABLE_CONN_POOL=false.