Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

uniqueness with no parameters? #30

Open
gbirchmeier opened this issue Oct 27, 2015 · 1 comment
Open

uniqueness with no parameters? #30

gbirchmeier opened this issue Oct 27, 2015 · 1 comment

Comments

@gbirchmeier
Copy link

(Forgive me if there is a better avenue for this question. The README does not indicate any place to ask for help.)

We had an event today where Sidekiq went down, but Clockwork kept pushing worker requests into Redis. When we restarted Sidekiq, multiple instances of my MxxWorker were queued up, and Sidekiq started running them concurrently, despite my having set sidekiq_options unique: :all in the class.

The worker takes no parameter, so these instances should not be unique. Why didn't Sidekiq discard the dupes. Am I misunderstanding how this is supposed to work?

Here is the relevant part of the class definition:

class MxxWorker
  include Sidekiq::Worker

  sidekiq_options unique: :all

  def perform
    MxxWorker.run(Rails.logger)
  end

  def self.run(logger = Logger.new(STDOUT))
    # blah code
  end

  # more code
end

Thanks to anyone who can enlighten me. I'd be happy to write some documentation about this once I understand it.

@masterkain
Copy link

I have the same issue, when performing a long job and we deploy, sidekiq will give 8 seconds before killing the worker and push the job back to redis; when sidekiq starts up again it will enqueue two jobs despite the uniqueness

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants