Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strange behaviour #172

Closed
rainerborene opened this issue Mar 9, 2016 · 3 comments
Closed

strange behaviour #172

rainerborene opened this issue Mar 9, 2016 · 3 comments
Labels

Comments

@rainerborene
Copy link

class DomainWorker
  include Sidekiq::Worker

  sidekiq_options queue: :platform, backtrace: true, unique: :until_executing

  def perform(account_id)
    account = Account.find account_id
    account.domains.each(&:sync!)
  end
end

# run in console
1000.times { DomainWorker.perform_async(4) }

You will notice that more than 1 job will be processed by Sidekiq. Any ideas how to solve this issue?

@mhenrixon
Copy link
Owner

I have some ideas but been traveling a lot over the last couple of months. Will get this fixed in the next release.

@heaven
Copy link

heaven commented Jun 25, 2016

The until_executing option makes a job unique before Sidekiq started to perform it, right? So is it possible your job finishes faster than 1000.times { DomainWorker.perform_async(4) }, the lock gets removed and Sidekiq is then allowed to queue one more job?

@mhenrixon
Copy link
Owner

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

No branches or pull requests

3 participants