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

Delete all locks button #357

Closed
scicco opened this issue Dec 6, 2018 · 6 comments
Closed

Delete all locks button #357

scicco opened this issue Dec 6, 2018 · 6 comments

Comments

@scicco
Copy link

scicco commented Dec 6, 2018

Is your feature request related to a problem? Please describe.
I'm still experiencing locks and jobs that stops being scheduled.
I've updated the gem version to 6.0.7 but I'm still seeing the count of uniquejobs raising time after time.
I usually check with this:
redis-cli --scan --pattern 'uniquejobs:*' | wc -l

Describe the solution you'd like
I'm currently cleaning my environment performing a delete of all keys when the system is "quiet"
redis-cli --scan --pattern 'uniquejobs:*' | xargs redis-cli DEL

A "Delete all locks" button inside Sidekiq Unique UI section page would be a nice to have.

Describe alternatives you've considered
upgrade of sidekiq version - no luck
upgrade of sidekiq-unique-jobs - no luck
I'm planning to drop sidetiq definitely and use sidekiq-cron instead

Additional context

I'm using ruby 2.3.4 version on Ubuntu

My Gemfile:

...
gem 'sidekiq-failures', github: 'mhfs/sidekiq-failures'
gem 'sidekiq-unique-jobs', "~> 6.0"
gem 'sidekiq', "~> 5.2.3"
gem 'sidetiq', github: 'tobiassvn/sidetiq'
gem 'sidekiq-status', "~> 0.6"
...

Gemfile.lock extract

GIT
  remote: https://github.com/mhfs/sidekiq-failures.git
  revision: ade3c0035e8b7df0821a71328fe31dc706226aeb
  specs:
    sidekiq-failures (1.0.0)
      sidekiq (>= 4.0.0)

GIT
  remote: https://github.com/tobiassvn/sidetiq.git
  revision: 261f213d8955ca416625d19dbf4e5cff007ef55b
  specs:
    sidetiq (0.7.2)
      celluloid (>= 0.17.3)
      ice_cube (~> 0.14.0)
      sidekiq (>= 4.1.0)
...
GEM
  remote: https://rubygems.org/
  specs:
    sidekiq (5.2.3)
      connection_pool (~> 2.2, >= 2.2.2)
      rack-protection (>= 1.5.0)
      redis (>= 3.3.5, < 5)
    sidekiq-status (0.8.1)
      chronic_duration
      sidekiq (>= 3.0)
    sidekiq-unique-jobs (6.0.7)
      concurrent-ruby (~> 1.0, >= 1.0.5)
      sidekiq (>= 4.0, < 6.0)
      thor (~> 0)
   ...

DEPENDENCIES
  ...
  sidekiq (~> 5.2.3)
  sidekiq-failures!
  sidekiq-status (~> 0.6)
  sidekiq-unique-jobs (~> 6.0)
  sidetiq!
  ...

Thank you for your help.

@fabioperrella
Copy link

After updating from 6.0.6 to 6.0.7 I feel there are fewer problems comparing with the previous version, but I keep seeing locks stuck in Redis. I think it is something related to scheduled + retry queues + failures.

For example, we have a worker A which enqueue other workers B. These workers B can re-enqueue it selves to run again after 1min if they are in a pooling state, and sometimes these jobs never run again because there is a lock which was not released correctly by some previous job.

In this case these are the keys which are not being deleted:

uniquejobs:0db9e4479efb08d860dc80388357c847:RUN:GRABBED
uniquejobs:0db9e4479efb08d860dc80388357c847:RUN:EXISTS

I think the lock is not being released correctly when the job fails and it is executed again by the retry queue. After the retry queue executes without error, I've noticed the jobs didn't run again (because they are locked).

@scicco
Copy link
Author

scicco commented Dec 13, 2018

Hello @fabioperrella I have the same behaviour:

...
uniquejobs:fff8bb7677a997a9d7c8d0e0f2be4d27:EXISTS
uniquejobs:fff8bb7677a997a9d7c8d0e0f2be4d27:GRABBED
...

@jagthedrummer
Copy link

I'm seeing this same thing.

@andrewls
Copy link

+1

@BagpipesJohnson
Copy link

BagpipesJohnson commented Jan 23, 2019

Also dealt with this. Had to go onto Redis and delete the keys myself before I was able to move on.

redis-cli --scan --pattern 'uniquejobs:*' | xargs redis-cli DEL

@mhenrixon
Copy link
Owner

I'll make it happen sometime soon!

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

6 participants