1

We are deploying versions of a sidekiq worker to Cloud Foundry as part of a continuous delivery pipeline. We need to stop workers processing new jobs if they are no longer the latest version. So:

  1. Worker v1 is running and performing a 30 min job.
  2. We deploy v2 of the worker code.
  3. v1 should continue with current jobs but not start any new ones.

CloudFoundry won't allow us to send USR1, so we need a solution that allows the workers to determine if they are the latest version before every job starts.

Benedict Dodd
  • 255
  • 3
  • 9

1 Answers1

2

Use a new queue name in your V2 codebase

e.g/

class ImportantWorker
  include Sidekiq::Worker
  sidekiq_options queue: :new_queue_name
  ....
end

and make sure you update your sidekiq config to reflect the new queue name

gef
  • 7,025
  • 4
  • 41
  • 48
  • 1
    I'd agree. Append a global version to all queue names in sidekiq.yml and your Workers. – Mike Perham Oct 01 '14 at 16:01
  • 1
    Excellent; seems to be working well although we'll need to see what happens to a mounting pile of orphaned queues and come up with a plan for stopping sidetiq for creating more jobs... – Benedict Dodd Oct 02 '14 at 16:33