feat(grpc-gcp): penalize retryable channel errors - #14219
Open
rahul2393 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces an error penalty mechanism for channels experiencing retryable errors (such as UNAVAILABLE or RESOURCE_EXHAUSTED). It adds configuration options for the penalty step and duration, tracks individual and aggregate penalty loads, and incorporates these penalties into the channel load calculations and scale-up signaling. Additionally, a comprehensive test suite has been added to verify the correctness of the error penalty logic under various scenarios. I have no feedback to provide.
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.
With dynamic scaling enabled, a channel returning retryable errors (UNAVAILABLE / RESOURCE_EXHAUSTED) kept its low active-stream count and so kept attracting picks: the pool had no signal that a channel was unhealthy until its streams actually piled up, and scale-up never triggered for a pool that was failing rather than busy.
Change
errorPenaltyStep(new pool option) of synthetic load to that channel forerrorPenaltyDuration, capped atmaxRpcPerChannel. The picker sees the penalty throughgetPickerLoad(), steering new picks toward healthy channels; expiry is lazy and lock-free.errorPenaltyStep = 0disables); no allocations added on the per-RPC path.