Upgrade the Sidekiq gem to v7.1.6
What does this MR do and why?
This MR upgrades sidekiq gem to v7.1.6
and sidekiq-cron gem to v1.9.1
. It resolves API breakages.
Track overall efforts in gitlab-com/gl-infra/scalability#2564 (closed)
To reviewers: reviewing commits in sequence would help as this branch has 2 large commits that were reviewed and approved MRs:
- !135185 (0085e3f7) was merged in !135186 (merged)
- !135185 (278f791e) was merged manually in !135187 (closed)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Verified that before and after sidekiq JSON job representation is the same
Before
"{\"retry\":3,\"queue\":\"default\",\"backtrace\":true,\"version\":0,\"queue_namespace\":\"chaos\",\"args\":[11],\"class\":\"Chaos::SleepWorker\",\"jid\":\"f21fe3beb3da23f289f86be5\",\"created_at\":1699923714.765107,\"correlation_id\":\"ac2f7e92507d1b71eb34971f565c1c5e\",\"worker_data_consistency\":\"always\",\"idempotency_key\":\"resque:gitlab:duplicate:default:9ab26637c0bf687029af25b2dfb66647757f6917880325df90d699e9e5c6b576\",\"size_limiter\":\"validated\",\"enqueued_at\":1699923714.773356}"
After
"{\"retry\":3,\"queue\":\"default\",\"backtrace\":true,\"version\":0,\"queue_namespace\":\"chaos\",\"args\":[12],\"class\":\"Chaos::SleepWorker\",\"jid\":\"e126f36af2ff24e8774c93e7\",\"created_at\":1699923640.797489,\"correlation_id\":\"ba3227290afa5551e0ded5f3390e3641\",\"worker_data_consistency\":\"always\",\"idempotency_key\":\"resque:gitlab:duplicate:default:ba3f65c50d3d403059bdbf86676ff9bb8c51e2c2cf474336b95993a5910b6434\",\"size_limiter\":\"validated\",\"enqueued_at\":1699923640.807325}"
Before | After |
---|---|
How to set up and validate locally
- Run gdk
- Tail logs using
gdk tail rails-background-jobs
- You should see cron job logs pop up from time to time (every minute)
- Send some scheduled jobs and async jobs using rails console
[1] pry(main)> Chaos::SleepWorker.perform_in(1, 4)
=> "ea2ecbf96f5500f4a69cd5f2"
[4] pry(main)> Chaos::SleepWorker.perform_async(1)
=> "aec4548261e5af26ca1d42d4"
- You should observe logs in tailed logs, for example:
2023-11-14_01:39:27.23441 rails-background-jobs : {"severity":"INFO","time":"2023-11-14T01:39:27.232Z","retry":3,"queue":"default","backtrace":true,"version":0,"queue_namespace":"chaos","class":"Chaos::SleepWorker","args":["4"],"jid":"ea2ecbf96f5500f4a69cd5f2","created_at":"2023-11-14T01:39:23.868Z","correlation_id":"e4803d32347678ca3a28a7f4fef43302","worker_data_consistency":"always","size_limiter":"validated","scheduled_at":"2023-11-14T01:39:24.867Z","idempotency_key":"resque:gitlab:duplicate:default:3f4b3177099baa5dd93a8ab6b3ae0f70cc91725fdfd17581421f12284b074382","enqueued_at":"2023-11-14T01:39:27.231Z","job_size_bytes":3,"pid":11305,"message":"Chaos::SleepWorker JID-ea2ecbf96f5500f4a69cd5f2: start","job_status":"start","scheduling_latency_s":0.000849,"enqueue_latency_s":2.363715}
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.
Edited by Sylvester Chin