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

Duplicate jobs getting created #257

Closed
rept opened this issue Feb 28, 2018 · 5 comments
Closed

Duplicate jobs getting created #257

rept opened this issue Feb 28, 2018 · 5 comments

Comments

@rept
Copy link

rept commented Feb 28, 2018

I have this code:

class SidekiqJob
  include Sidekiq::Worker
  include Sidekiq::Status::Worker
  sidekiq_options queue: :default, retry: false, unique: :until_and_while_executing
end
class CheckAlertsJob < SidekiqJob
  def perform
    AlertType.where("coalesce(condition) <> ''").each do |alert_type|
      alert_type.check_for_alerts
    end
  end
end

There is any task running (CheckAlertsJob) and still new jobs are being queued. What is wrong?

image

@ragesoss
Copy link

Maybe the locks are expiring? By default, the unique lock only lasts for 30 minutes. See #250 .

@mhenrixon
Copy link
Owner

mhenrixon commented Jun 6, 2018

What version of sidekiq and unique jobs are you on? Which version of Redis? @rept

@kammerer
Copy link

kammerer commented Jun 11, 2018

I encountered the same/similar issue. Duplicate jobs are being run for :while_executing and :until_and_while_executing (I verified that jobs are actually run in parallel).

  • sidekiq-unique-jobs 5.0.10
  • sidekiq 4.2.10
  • ruby 2.4.1
  • redis 3.0.6

Edit: tried it with 88ed7a9. It still runs duplicate jobs.

@mhenrixon
Copy link
Owner

@kammerer could you try the master branch? You can't use the master branch with Sidekiq::Testing though.

@mhenrixon
Copy link
Owner

Version 6 won't have this problem and it will take care of the upgrade automatically.

Keep an eye out on the README and CHANGELOG for more information about the changes.

@mhenrixon mhenrixon added this to the Version 6.0 milestone Jun 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants