porta icon indicating copy to clipboard operation
porta copied to clipboard

THREESCALE-9596: Upgrade to Sidekiq 7

Open jlledom opened this issue 11 months ago • 0 comments

What this PR does / why we need it:

Now we are going to have a RHEL8 based image soon it's time to work on upgrading to Sidekiq 7 again. This is required to add support for TLS and ACL for Redis: https://github.com/3scale/porta/pull/3572.

This PR is basically a reversion of https://github.com/3scale/porta/pull/3608 with a few changes to adapt it to the last alpha. However, one of the new changes is replacing include Sidekiq::Worker by include Sidekiq::Job. Most of changes in this PR are about that.

Which issue(s) this PR fixes

THREESCALE-9596 THREESCALE-10207

Verification steps

Sidekiq should work without issues. One particular scenario to consider is adding jobs with Sidekiq 6 and perform them with Sidekiq 7, those jobs should be performed successfully.

Special notes for your reviewer:

  • Problem with sidekiq-throttled:
    • Currently we are using 0.15.0. However this version doesn't support ActiveJob, which means that throttling and concurrency control just never worked for us, and this kind of calls are in practice being ignored: https://github.com/3scale/porta/blob/bc9f1d59a3b850c791fef40191c06b3592f2ea74/app/workers/backend_metric_worker.rb#L8-L14
    • Support for ActiveJob was partially added in https://github.com/ixti/sidekiq-throttled/pull/116 and https://github.com/ixti/sidekiq-throttled/pull/151
    • Last version 1.3.0 includes above fixes, but still doesn't support ActiveJob with arguments. I opened a PR for that: https://github.com/ixti/sidekiq-throttled/pull/184
    • While my PR gets reviewed and merged, you can point to my fork in order to have a fully functional Sidekiq 7 in case you want to make tests locally:
      gem 'sidekiq-throttled', '~> 1.3.0', github: 'jlledom/sidekiq-throttled', branch: 'activejob-args'
      
  • I'm forcing to use redis-client (= 0.20.0) because of https://github.com/redis-rb/redis-client/issues/182

jlledom avatar Mar 15 '24 12:03 jlledom