Skip to content

impl(bigtable): add DynamicChannelPool class#16037

Draft
scotthart wants to merge 1 commit intogoogleapis:mainfrom
scotthart:bigtable_dynamic_channel_pool
Draft

impl(bigtable): add DynamicChannelPool class#16037
scotthart wants to merge 1 commit intogoogleapis:mainfrom
scotthart:bigtable_dynamic_channel_pool

Conversation

@scotthart
Copy link
Member

No description provided.

@product-auto-label product-auto-label bot added the api: bigtable Issues related to the Bigtable API. label Mar 9, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant enhancement to how Bigtable clients manage their gRPC connections. By implementing a DynamicChannelPool, the system can now intelligently scale the number of active gRPC channels up or down based on the current RPC load. This dynamic adjustment aims to optimize resource utilization, reduce latency during peak loads, and improve overall efficiency for Bigtable operations by ensuring an appropriate number of channels are available without over-provisioning.

Highlights

  • Dynamic Channel Pool Introduction: Introduced a new DynamicChannelPool class designed to manage gRPC channels for Bigtable, enabling dynamic scaling based on current RPC load.
  • Configurable Sizing Policy: Implemented a DynamicChannelPoolSizingPolicy structure, allowing configuration of how the channel pool grows and shrinks, including cooldown intervals and thresholds for average outstanding RPCs.
  • Unit Tests for Dynamic Behavior: Added comprehensive unit tests for the DynamicChannelPool to validate its functionality, channel selection logic, and dynamic resizing behavior under various conditions.
  • Build System Integration: Updated CMake and Bazel build configurations to properly include the new dynamic_channel_pool.h header and dynamic_channel_pool_test.cc source file.
  • ChannelUsage Enhancements: Modified channel_usage.h to include a testing-specific constructor and adjusted the average_outstanding_rpcs logic to support initial RPC counts for test scenarios.
Changelog
  • google/cloud/bigtable/CMakeLists.txt
    • Added internal/dynamic_channel_pool.h to the library sources.
    • Added internal/dynamic_channel_pool_test.cc to the test sources.
  • google/cloud/bigtable/bigtable_client_unit_tests.bzl
    • Added internal/dynamic_channel_pool_test.cc to the list of unit tests.
  • google/cloud/bigtable/google_cloud_cpp_bigtable.bzl
    • Added internal/dynamic_channel_pool.h to the list of header files.
  • google/cloud/bigtable/internal/channel_usage.h
    • Added a constructor for testing purposes that allows setting an initial outstanding RPC count.
    • Adjusted average_outstanding_rpcs to account for initial RPC counts in testing.
    • Added std::cout statements for debugging in AcquireStub and the new testing constructor.
  • google/cloud/bigtable/internal/dynamic_channel_pool.h
    • Implemented the DynamicChannelPool class, which manages a pool of ChannelUsage objects and dynamically adjusts its size based on RPC load.
    • Defined DynamicChannelPoolSizingPolicy to configure pool behavior.
  • google/cloud/bigtable/internal/dynamic_channel_pool_test.cc
    • Added comprehensive unit tests for the DynamicChannelPool class, covering channel selection, pool resizing, and handling of empty/single-channel pools.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

❌ Patch coverage is 70.31963% with 130 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.60%. Comparing base (8989a78) to head (1a1c5ee).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...gle/cloud/bigtable/internal/dynamic_channel_pool.h 48.49% 120 Missing ⚠️
...oud/bigtable/internal/dynamic_channel_pool_test.cc 94.87% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16037      +/-   ##
==========================================
- Coverage   92.64%   92.60%   -0.04%     
==========================================
  Files        2337     2339       +2     
  Lines      214938   215375     +437     
==========================================
+ Hits       199125   199457     +332     
- Misses      15813    15918     +105     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@scotthart scotthart force-pushed the bigtable_dynamic_channel_pool branch from 1a1c5ee to cc64a90 Compare March 10, 2026 20:23
@scotthart scotthart force-pushed the bigtable_dynamic_channel_pool branch from cc64a90 to 0eaf8dc Compare March 10, 2026 21:07
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.

1 participant