Register Sidekiq queues only from routing rules
What does this MR do and why?
Register Sidekiq queues only from routing rules
Also clean up other queues that are outside routing rules. Most instances would have hundreds of unused queues back when we were still running queues per worker.
Changelog: changed
For #415298
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
With empty routing rules
-
Ensure
sidekiq.routing_rules
is empty ingitlab.yml
-
Restart sidekiq
gdk restart rails-background-jobs
-
Check Rails console
[8] pry(main)> Sidekiq::Queue.all.map(&:name) => ["default", "mailers"]
-
Or check
queues
set in Redis
❯ gdk redis-cli -n 1 smembers queues
1) "default"
2) "mailers"
With a custom routing rules
-
Paste this in
gitlab.yml
sidekiq: log_format: json # (default is also supported) routing_rules: - ["urgency=high", "urgent"] - ["urgency=low", "not-urgent"] - ["*", "default"]
-
Restart
gdk restart rails-background-jobs
-
Check queues
❯ gdk redis-cli -n 1 smembers queues 1) "urgent" 2) "not-urgent" 3) "default" 4) "mailers"
Edited by Gregorius Marco