Skip to content

fix(gax): Remove strict validation that resize delta must be less than max channel count#12863

Merged
lqiu96 merged 36 commits intomainfrom
fix/channelpool-logic-fix
Apr 23, 2026
Merged

fix(gax): Remove strict validation that resize delta must be less than max channel count#12863
lqiu96 merged 36 commits intomainfrom
fix/channelpool-logic-fix

Conversation

@lqiu96
Copy link
Copy Markdown
Member

@lqiu96 lqiu96 commented Apr 20, 2026

Address some comments in #12838

It is possible that users use the DEFAULT_RESIZE_DELTA (2) with a statically sized channel pool (1). We should not enforce that the resize delta needs to be less than or equal to the channel pool. Instead, the channel pool's tentative target is calculated to be clamped within the channelpoolsetting's configured bounds.

lqiu96 and others added 20 commits April 17, 2026 17:09
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 introduces a configurable maxResizeDelta to the ChannelPoolSettings and implements a mechanism to log a warning when the channel pool undergoes repeated resizing cycles. It also includes several bug fixes related to channel count clamping and improves the internal logic for determining when a resize is necessary. The review feedback identifies a validation check for maxResizeDelta that is overly restrictive and could cause failures in valid configurations, such as small pools. Additionally, there is a concern regarding the thread safety of the consecutiveResizes counter, which is currently a primitive integer accessed outside of synchronized blocks.

@lqiu96 lqiu96 marked this pull request as ready for review April 20, 2026 20:23
@lqiu96 lqiu96 requested a review from a team as a code owner April 20, 2026 20:23
@lqiu96 lqiu96 changed the base branch from main to feat/channelpool-resizing April 20, 2026 20:23
lqiu96 added 4 commits April 21, 2026 14:34
…unds

# Conflicts:
#	sdk-platform-java/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/ChannelPoolTest.java
# Conflicts:
#	sdk-platform-java/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/ChannelPoolSettings.java
#	sdk-platform-java/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/ChannelPoolTest.java
…y static pool config

# Conflicts:
#	sdk-platform-java/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/ChannelPoolSettings.java
#	sdk-platform-java/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/ChannelPoolTest.java
@lqiu96 lqiu96 force-pushed the fix/channelpool-logic-fix branch from cc0cb9b to 1c205e3 Compare April 21, 2026 18:36
Base automatically changed from feat/channelpool-resizing to main April 21, 2026 19:23
@lqiu96 lqiu96 requested a review from jinseopkim0 April 21, 2026 20:06
@lqiu96 lqiu96 changed the title fix: Channel clamping logic in ChannelPools to respect configured channel bounds fix: Channel resize logic in to respect configured channel bounds Apr 21, 2026
@lqiu96 lqiu96 requested a review from blakeli0 April 22, 2026 17:13
@lqiu96 lqiu96 changed the title fix: Channel resize logic in to respect configured channel bounds fix: Channel resizes with resize target is limited within channel bounds Apr 22, 2026
@lqiu96 lqiu96 changed the title fix: Channel resizes with resize target is limited within channel bounds fix: Enforce resize delta limits to be within channel bounds Apr 22, 2026
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed for 'gapic-generator-java-root'

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed for 'gapic-generator-java-root'

Failed conditions
8.2% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@lqiu96 lqiu96 changed the title fix: Enforce resize delta limits to be within channel bounds fix(gax): Remove strict validation that resize delta must be less than max channel count Apr 22, 2026
@lqiu96 lqiu96 requested review from blakeli0 and jinseopkim0 April 22, 2026 21:49
@lqiu96 lqiu96 merged commit 26b06f9 into main Apr 23, 2026
160 of 165 checks passed
@lqiu96 lqiu96 deleted the fix/channelpool-logic-fix branch April 23, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants