Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request renames maxIdleSessions to maxSessions in PoolSizer and caps the total desiredCapacity at maxSessions. It also adds a unit test to verify this capping behavior. The reviewer pointed out that the desiredCapacity calculation in the existing testEquilibriumWhenStartingWithLoad test should also be updated to cap at MAX_SESSIONS to match the new production logic and prevent potential test failures.
mutianf
commented
Nov 16, 2026
Comment on lines
+30
to
+32
| private volatile float idlesSessionHeadRoom; | ||
| private volatile int minIdleSessions; | ||
| private volatile int maxIdleSessions; | ||
| private volatile int minSessions; | ||
| private volatile int maxSessions; |
Contributor
There was a problem hiding this comment.
do these need to be volatile? I thought PoolSizer was only used under lock?
Contributor
Author
There was a problem hiding this comment.
No, we probably didn't clean this up after the re-write
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1 of 4 for b/584671437.
What changed
PoolSizer.getScaleDelta(), ignore queuedpendingRpcsfor scale-up whileconsecutiveFailures > 0so accumulating pending requests do not trigger unbounded session creation when session establishment is failing.consecutiveFailures >= consecutive_session_failure_threshold, allow at most 1STARTINGprobe session at a time (startingCount == 0 ? 1 : 0).SessionPoolImpl.onSessionReady(), scale the pool back up when recovering fromconsecutiveFailures > 0.isDisabled()at the start ofgetScaleDelta()and remove unnecessaryvolatilemodifiers fromPoolSizerfields guarded bypoolLock.