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

Job.delete does not remove lock in all circumstances #205

Closed
ewalk153 opened this issue Jan 19, 2017 · 2 comments
Closed

Job.delete does not remove lock in all circumstances #205

ewalk153 opened this issue Jan 19, 2017 · 2 comments

Comments

@ewalk153
Copy link

I'm using the until_and_while_executing (my case may or may not be related to this job type).

For this sample job:

class Sample
  include Sidekiq::Worker
  sidekiq_options unique: :until_and_while_executing

  def perform(arg1)
    Rails.logger.info("Job called with #{arg1}")
  end
end

When I delete the job, the lock fails to be removed. For example:

k = Sample.perform_async "hi"
puts "Next queue return #{Sample.perform_async 'hi'} (nil means locked)"
j = Sidekiq::Queue.new.find_job k
j.delete # this should remove the lock
puts "Next queue return #{Sample.perform_async 'hi'} (nil means locked)"

I've looked into sidekiq-unique-jobs and changing https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/lib/sidekiq_unique_jobs/sidekiq_unique_ext.rb#L95
from unlock(item) to SidekiqUniqueJobs::Unlockable.unlock(item) resolves the problem for me.

Would you like me to submit a pull request? How can I help resolve this problem?

@mhenrixon
Copy link
Owner

Check version 5.0.0 if this is still an issue?

@ewalk153
Copy link
Author

ewalk153 commented Apr 9, 2017

Sounds good, I'll check it out.

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

No branches or pull requests

2 participants