Comments (5)
My current solutions:
SidekiqUniqueJobs.reflect do |on|
on.lock_failed do |job_hash|
# There is a problem where job is executed and digest has been remove from SidekiqUniqueJobs::Digests.new.entries BUT the job_id still exists.
# If your worker using SidekiqUniqueJobs's lock stratery with reject on conflit, then it will reject new job from being added to the queue even the job nolonger available.
# This aims to handle that case and clear the invalid digest
if job_hash['class'] == 'YourWokerClassName' &&
Redis.current.get(job_hash['lock_digest']) &&
Redis.current.zrank('uniquejobs:digests', job_hash['lock_digest']).nil?
SidekiqUniqueJobs::Digests.new.delete_by_digest(job_hash['lock_digest'])
job_hash['class'].constantize.perform_async(*job_hash['args'])
end
end
end
from sidekiq-unique-jobs.
further debugging: "Delete All" on the web UI - locks are shown as cleared out on the UI. However the job still reports that the same key already exists.
> SidekiqUniqueJobs::Digests.new.entries
{"uniquejobs:f4f7dbd00db80a837590354401621908"=>1664566736.618991,
"uniquejobs:e5a9ea4f8e153a35f6ded5f23fb1e527:RUN"=>1664566738.4878461,
"uniquejobs:9a10d00cc95305531be30f13b956005c:RUN"=>1664566738.8416214,
"uniquejobs:2b19449a7adaa1461106a72cabe12a6f:RUN"=>1664566738.8636317,
"uniquejobs:51cf0c68620db7b16d433b178e39d7e1:RUN"=>1664566739.4959993}
no match in the entries
however directly deleting by digest does succeed and releases the lock
> SidekiqUniqueJobs::Digests.new.delete_by_digest 'uniquejobs:1d6a8b849137793a8368e6513b58f436'
2022-09-30T19:41:59.911Z pid=16756 tid=ktw INFO: delete_by_digest(uniquejobs:1d6a8b849137793a8368e6513b58f436) completed in 1ms
=> 2
> ActivityItems::ItemCreateJob.perform_async
=> "324a590dbf84f5315c32cb09"
However then jobs can just be queued repeatedly even with until_and_while_executing
. This seems the same as #734?
> ActivityItems::ItemCreateJob.perform_async
=> "4200cb3e8be0a9c5ba32ff7f"
> ActivityItems::ItemCreateJob.perform_async
=> "630c1eba5d46b279ba232a20"
> ActivityItems::ItemCreateJob.perform_async
=> "52389da6ff7d8daf89352f8a"
> ActivityItems::ItemCreateJob.perform_async
=> "1eda77d1672570eedada7b8f"
from sidekiq-unique-jobs.
We had the exact same problem today.
sidekiq (5.2.9)
sidekiq-unique-jobs (7.1.27)
from sidekiq-unique-jobs.
Same problem here:
sidekiq (6.4.1)
sidekiq-unique-jobs (7.1.7)
I'm also unable to find the digest in the locked list SidekiqUniqueJobs::Digests.new.entries
Here is where it check job_id by digest: CLICK FOR LINK:
- The previous digest still exists which leads to prev_job_id being different from new_job_id:
- Example Digest:
uniquejobs:4cd6c68aa2b68f076fb793b18fd49f1e
.
irb(main):419:0> Redis.current.get('uniquejobs:4cd6c68aa2b68f076fb793b18fd49f1e')
=> "5837f8f8bdd9977f02d0642d"
It seems like Cleanup Dead Locks couldn't delete the digest.
from sidekiq-unique-jobs.
Related Issues (20)
- concurrent-ruby has dropped support for TimerTask timeouts HOT 1
- concurrent-ruby 1.1.10 spikes volume of jobs HOT 8
- Ambiguity about `death_handers`
- DEPRECATION WARNING: default_worker_options is deprecated and will be removed from Sidekiq 7.0 (use default_job_options instead) (called from notify_agents at /Users/hackeron/Development/Tether/timeline/app/models/user.rb:303) HOT 3
- Reviwing: Failed jobs waiting to be retried are not considered when fetching uniqueness
- Unexpected behavior with until_and_while_executing HOT 4
- Disable logging in Rails testing HOT 7
- Unique Jobs Not Running with Version 7.1.26 HOT 12
- spammed by `Nothing to delete; exiting` during spec HOT 2
- Jobs are being allowed to run even though there is a lock HOT 8
- Incompatibility with Sidekiq 7 HOT 12
- Job executed twice when reaper runs
- Error "undefined method `redis_info' for Sidekiq:Module" on upgrade HOT 2
- Using rspec matcher and getting: `NameError: uninitialized constant SidekiqUniqueJobs::Lock::BaseLock::Validator`
- until and while executing with different arguments for client/server HOT 2
- Got often got Limit exceeded message in changelog HOT 6
- Unlock jobs when queue is deleted HOT 2
- Allow one running job but at most one job in the queue HOT 2
- while_executing jobs being dropped HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sidekiq-unique-jobs.