Disable cron poller via envvar
What does this MR do and why?
This MR allows users to disable the cron_poller by setting the environment variable GITLAB_CRON_JOBS_POLL_INTERVAL=0. This functionality will be used by gitlab.com to deprecate the use of namespace in Sidekiq (See details of per-shard rollout gitlab-com/gl-infra/scalability#2481).
We can disable the cron poller by setting cron_poll_interval to a negative number. However, configMap configures cron_job via the global.appConfig map which prevents us from targeting individual shard deployments.
A targeted approach via envvar allows us to run 2 groups of sidekiq workers with different SIDEKIQ_ENQUEUE_NON_NAMESPACED values (!116379 (merged)). This controlled rollout is safer than a big-bang approach of disabling all namespaces in all Sidekiq pods on 1 deployment.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
How to set up and validate locally
On the master branch, visit http://gdk.test:3000/admin/sidekiq/cron. The last enqueued column will update over time (set live polling on the top right corner).
On this branch
- Set
GITLAB_CRON_JOBS_POLL_INTERVAL=0in your gdk'senv.runitfile. - Restart sidekiq via
gdk restart rails-background-jobs - Monitor the cron page
http://gdk.test:3000/admin/sidekiq/cron, no more crons should run. tip: just leave it for 5-10 minutes, there should be no morejust noworx seconds ago.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.