Rate limit the job submission request - #866
Open
hellolittlej wants to merge 1 commit into
Open
Conversation
hellolittlej
requested review from
Andyz26,
calvin681,
dtrager02,
fdc-ntflx and
james-lubin
as code owners
July 30, 2026 17:06
Test Results167 files + 3 167 suites +3 10m 43s ⏱️ +25s For more details on these failures, see this check. Results for commit 8d0199a. ± Comparison against base commit 25ff35c. ♻️ This comment has been updated with latest results. |
hellolittlej
force-pushed
the
rate-limit-job-submission
branch
2 times, most recently
from
August 4, 2026 20:30
9cfd8a5 to
a8c0223
Compare
hellolittlej
force-pushed
the
rate-limit-job-submission
branch
2 times, most recently
from
August 5, 2026 05:56
b9faf36 to
ca6bbe8
Compare
hellolittlej
force-pushed
the
rate-limit-job-submission
branch
from
August 5, 2026 06:43
ca6bbe8 to
8d0199a
Compare
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.
What
Adds an opt-in, per route based bucket rate limit.For jobsRoute, add the rate limit in front of the three v1 job-creation endpoints:
POST /api/v1/jobsPOST /api/v1/jobClusters/{cluster}/jobsPOST /api/v1/jobs/actions/quickSubmitThe rate
Configuration
mantis.master.api.v1.submitJob.throttle.enabledfalsemantis.master.api.v1.submitJob.permitsPerSecond1000Off by default because the right ceiling depends on cluster size and traffic —
operators opt in once they've measured their own submit rate. The rate is backed by a
LongDynamicProperty, so it re-reads on the dynamic-property refresh interval(
mantis.config.dynamic.refreshSecs, default 30s).Metrics
MasterApiMetrics/throttledRequestCountgains asourcetag (submitJob,resourceCluster), so an operator can tell which limit is shedding. Previously theroute-level throttle and the resource-cluster gateway's
RequestThrottledExceptionboth incremented the same untagged counter.
Checklist
./gradlew buildcompiles code correctly./gradlew testpasses all tests