fix(gax): Remove strict validation that resize delta must be less than max channel count#12863
fix(gax): Remove strict validation that resize delta must be less than max channel count#12863
Conversation
This reverts commit 91ffb52.
There was a problem hiding this comment.
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.
…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
…y static pool config
cc0cb9b to
1c205e3
Compare
|
|


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.