Rate limit RestateDeployment cleanup queries - #186
Draft
pcholakov wants to merge 1 commit into
Draft
Conversation
pcholakov
force-pushed
the
pavel/rate-limit-restatedeployment-queries
branch
from
August 13, 2026 11:22
74b9cf0 to
2668d38
Compare
darkmuggle
approved these changes
Aug 13, 2026
Contributor
|
let's see if #190 is enough before we go down this route. as i note in the description of that PR, there are still scenarios where the query may run a lot, and in those cases this (and Ben's addition) seem appropriate. but let's not unless we need it. |
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.
Summary
Rate limit expensive RestateDeployment deployment-usage queries so resources targeting the same Restate Admin API endpoint do not multiply query load.
Approach and decisions
Validation
RUSTC_WRAPPER='' cargo test --all-targetsRUSTC_WRAPPER='' cargo clippy --all-targets -- -D warningscargo fmt --checkRUSTC_WRAPPER='' cargo test --lib controllers::restatedeployment::e2e -- --ignored --nocapture --test-threads=1AI-generated investigation context
The rate limit is endpoint-scoped because one operator can manage RestateDeployment resources for multiple Restate environments. The permit stays in flight until the HTTP request completes, preventing a second resource from starting an expensive query after a fixed delay while a slow first query is still running. Retry scheduling uses deferred reconciles and jitter to avoid synchronized retry bursts.