Skip to content

Commit 5ddf8d4

Browse files
authored
fix(bigtable): disable dynamic channel pool by default and raise default pool size to 10 (#19945)
## Summary - Disable dynamic channel pool scaling by default (`DefaultDynamicChannelPoolConfig().Enabled` flipped from `true` to `false`). - Raise the default gRPC connection pool size from 4 to 10 to align with `defaultBigtableConnPoolSize` and compensate for the loss of dynamic scale-up. ## Why Mitigates steady heap growth caused by the upstream gRPC-Go xDS client memory leak in DirectPath-xDS connections. Scale events churn connections often enough to expose that leak, and the prior pool default of 4 amplified the problem under load. See #14582. Pairs with the connection-recycler `MaxAge` bump (7d) in a sibling PR — both reduce DirectPath-xDS connection churn while the upstream fix lands. ## Compatibility - `ClientConfig.DisableDynamicChannelPool` keeps its existing semantics; users who already opt out are unaffected. - Callers who want dynamic scaling can construct a `DynamicChannelPoolConfig` with `Enabled: true`. ## Test plan - [x] `go build ./...` clean - [x] `go vet ./...` clean - [x] `go test ./internal/transport/... ./internal/option/... ./` (targeted: TestDynamic/TestValidate/TestConnPool/TestNewClient) — pass - [ ] CI green
1 parent b66bbc1 commit 5ddf8d4

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

bigtable/client.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,12 @@ func NewClientWithConfig(ctx context.Context, project, instance string, config C
124124
// Add gRPC client interceptors to supply Google client information. No external interceptors are passed.
125125
o = append(o, btopt.ClientInterceptorOptions(nil, nil)...)
126126
o = append(o, option.WithGRPCDialOption(grpc.WithStatsHandler(sharedLatencyStatsHandler)))
127-
// Default to a small connection pool that can be overridden.
127+
// Default to a connection pool that can be overridden. Raised from 4 to
128+
// defaultBigtableConnPoolSize to compensate for dynamic channel pool
129+
// scaling being disabled by default
130+
// (see https://github.com/googleapis/google-cloud-go/issues/14582).
128131
o = append(o,
129-
option.WithGRPCConnectionPool(4),
132+
option.WithGRPCConnectionPool(defaultBigtableConnPoolSize),
130133
// Set the max size to correspond to server-side limits.
131134
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(grpc.MaxCallSendMsgSize(1<<28), grpc.MaxCallRecvMsgSize(1<<28))),
132135
)

bigtable/internal/option/option.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,17 @@ type DynamicChannelPoolConfig struct {
249249
// E.g., 30 means a maximum increase of 30%.
250250
}
251251

252-
// DefaultDynamicChannelPoolConfig is default settings for dynamic channel pool
252+
// DefaultDynamicChannelPoolConfig is default settings for dynamic channel pool.
253+
//
254+
// Enabled is false by default while the upstream gRPC-Go xDS client memory leak
255+
// is being addressed; scale events churn DirectPath-xDS connections often
256+
// enough to expose that leak as steady heap growth
257+
// (see https://github.com/googleapis/google-cloud-go/issues/14582). Callers
258+
// that want dynamic scaling can construct a DynamicChannelPoolConfig with
259+
// Enabled: true.
253260
func DefaultDynamicChannelPoolConfig() DynamicChannelPoolConfig {
254261
return DynamicChannelPoolConfig{
255-
Enabled: true, // Enabled by default
262+
Enabled: false,
256263
MinConns: 10,
257264
MaxConns: 200,
258265
AvgLoadHighThreshold: 50,

0 commit comments

Comments
 (0)