Skip to content

feat(bigtable): enable bigtable conn pool by default#14319

Merged
mutianf merged 3 commits intogoogleapis:mainfrom
sushanb:enable_conn
Apr 9, 2026
Merged

feat(bigtable): enable bigtable conn pool by default#14319
mutianf merged 3 commits intogoogleapis:mainfrom
sushanb:enable_conn

Conversation

@sushanb
Copy link
Copy Markdown
Contributor

@sushanb sushanb commented Apr 1, 2026

Can be disabled via CBT_BIGTABLE_CONN_POOL=false.

@sushanb sushanb requested a review from nimf April 1, 2026 01:36
@sushanb sushanb requested review from a team as code owners April 1, 2026 01:36
@product-auto-label product-auto-label Bot added the api: bigtable Issues related to the Bigtable API. label Apr 1, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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
  1. 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.

@mutianf mutianf enabled auto-merge (squash) April 8, 2026 20:44
@mutianf mutianf disabled auto-merge April 8, 2026 20:50
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.
@mutianf mutianf merged commit db45f2d into googleapis:main Apr 9, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigtable Issues related to the Bigtable API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants