Conversation
Add optional admission and deadline settings for ShouldRateLimit. Reject excess calls immediately and retain capacity until synchronous processing and completion metric recording finish. Preserve HTTP caller contexts and distinguish overload from quota decisions. Signed-off-by: Gregory Giecold <ggiecold@nvidia.com>
Signed-off-by: Gregory Giecold <ggiecold@nvidia.com>
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.
Problem
Slow cache calls can retain
ShouldRateLimithandlers after callers cancel. Without configured bounds, more gRPC streams can keep arriving while that work is stuck.Change
Add optional per-instance request admission, a cache-work deadline, and a per-connection gRPC stream cap. Calls above the admission limit fail immediately with
ResourceExhausted, separate from anOVER_LIMITquota decision. Add admission metrics, preserve HTTP caller contexts, and map service errors to HTTP status codes.Runtime contract
MAX_CONCURRENT_REQUESTS,REQUEST_TIMEOUT, andGRPC_MAX_CONCURRENT_STREAMSall default to0(disabled); operators must set bounds explicitly. The gRPC cap applies per connection, not per instance or to HTTP/json. A conforming client waits for stream capacity or its own deadline; it does not get an immediate application overload response from the stream cap.Admission capacity remains occupied until synchronous work and completion-metric recording return, even after caller cancellation. The deadline is a cancellation signal, not a guarantee that Radix promptly drains a response or that Redis stops a command already sent. Shadow mode does not override service failures; rollout must account for the caller's failure policy.
Validation
Focused server, settings, and service tests pass. The gRPC tests verify HTTP/2 SETTINGS and one-connection deadline/recovery behavior. The stalled-Redis test uses the real client against a loopback RESP fixture and verifies that a cancelled call retains its admission slot until backend work returns.