Loading
Make the scheduler rate limit period an application setting
What does this MR do and why?
Moves the period of the per-project auto-remediation scheduler rate limit into the security_update_scheduler_project_period_in_seconds application setting. The default is 300, the same five minutes as today, and 0 removes the limit. The maximum is 86400, one day. Administrators can tune the limit without a deploy.
- The setting sits in the existing
dependency_management_settingshash next tosecurity_update_scheduler_max_concurrency, so there is no migration. - Both scheduler rules, runs and reschedules, read their period from it.
- With
0,limit_applies?already skips the key before any Redis call, so the scheduler has no guard of its own. - The limit moves from the non-configurable rate limits table to the configurable list in the rate limits docs.
References
- Rollout issue: https://gitlab.com/gitlab-org/gitlab/-/work_items/638559
- Phase 1: https://gitlab.com/gitlab-org/gitlab/-/work_items/636846
- Rate limit MR: !267539 (merged)
- Flag removal MR: !272129 (merged)
Screenshots or screen recordings
Not applicable. There is no UI change.
How to set up and validate locally
- As an administrator, set the period to 60 seconds:
curl --request PUT --header "PRIVATE-TOKEN: <admin-token>" \ --header "Content-Type: application/json" \ --data '{"dependency_management_settings": {"security_update_scheduler_project_period_in_seconds": 60}}' \ "http://gdk.test:3000/api/v4/application/settings" - In the Rails console, check that both rules use it:
Gitlab::ApplicationRateLimiter::LabkitAdapter::SupportedRateLimits.period_for(:dependency_management_scheduler_run) # => 60 Gitlab::ApplicationRateLimiter::LabkitAdapter::SupportedRateLimits.period_for(:dependency_management_scheduler_reschedule) # => 60 - Set the value to
0and run two pipelines on a project with an auto-remediation profile.log/application_json.loghas noDependencyManagement: scheduler run throttledline.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Albina Yusupova