Comments (11)
This issue is negating the core function of the gem, because locks are disappearing. Upgrading to 8 isn't really a viable option because other middlewares haven't fully caught up to the latest Sidekiq yet. Looking forward to the backport.
I know! Iโll try to sort it out this week. It has been a crazy year, hard to get to the open source work.
Prioritizing this today and tomorrow.
from sidekiq-unique-jobs.
It does something like this:
- Considers the lock active if not enough time has passed
- Checks what is enqueued
- Checks what is scheduled
- Checks what the workers are processing
May I ask what version you are on? I just fixed exactly your problem the other week.
from sidekiq-unique-jobs.
I don't believe I backported it. Sorry, been away clearing my head and meditating for two weeks in silence. I'll see if can get to this sometime this week.
from sidekiq-unique-jobs.
@mhenrixon This should be fixed as of #799 and v7.1.30, right?
from sidekiq-unique-jobs.
@mhenrixon This should be fixed as of #799 and v7.1.30, right?
Yes sir
from sidekiq-unique-jobs.
@democlitos I have a few reaper improvements on the main branch right now. It is only released once it is verified by someone that it is working better.
#830 amongst others
from sidekiq-unique-jobs.
First of all, long running jobs are like ddosing yourself.
https://twitter.com/nateberkopec/status/1635280301709746179?s=46
That said, I'm sure there is something that could be done to improve.
Unfortunately, I am out of commission for a few weeks so won't be able to look at it until end of May at best.
from sidekiq-unique-jobs.
We are aware that running long jobs is not ideal... In this case we only have one... but when the lock is cleaned up and other jobs start to run, we do DDOS ourselves.
Could you provide any info about how the reaper decides to clean something up? Is it just based on how old the lock is? Or does it try and check that the job is still running?
Looking through the code, it looks like belongs_to_job? tries looks to see if the digest belongs to a job that still exists. It looks like active? tries to see if the job is still active. Is this where my problem is likely to be found?
from sidekiq-unique-jobs.
We are on version 7.1.29
Are you referring to #756 ?
Did this change get ported back into the version 7 branch?
from sidekiq-unique-jobs.
This issue is negating the core function of the gem, because locks are disappearing. Upgrading to 8 isn't really a viable option because other middlewares haven't fully caught up to the latest Sidekiq yet. Looking forward to the backport.
from sidekiq-unique-jobs.
Versions: sidekiq 7.1.5, sidekiq-cron 1.9.1, sidekiq sidekiq-unique-jobs 8.0.3
I'm experiencing a similar issue. I have a worker FetchAssetValueWorker (lock: :until_executed, on_conflict: :reject
) that runs every 10 minutes (scheduled using sidekiq-cron). Under specific circumstances, this worker may take more than 30 minutes to run. Everytime this worker is added to the dead queue for being rejected, for some reason it's also removed from redis (through delete_by_digest
command):
2023-10-10T02:00:13.770Z pid=1 tid=hs1 uniquejobs=client until_executed=uniquejobs:bc7b7713595a5fb14e4ed3456bfd9049 INFO: Adding dead FetchAssetValueWorker job 83d9a5a3e96f64bbd7a920db
2023-10-10T02:00:13.775Z pid=1 tid=hs1 uniquejobs=client until_executed=uniquejobs:bc7b7713595a5fb14e4ed3456bfd9049 INFO: delete_by_digest(uniquejobs:bc7b7713595a5fb14e4ed3456bfd9049) completed in 3ms
Because of this, the worker will be duplicated if it takes more than 20 minutes to complete. I didn't see anything about this behavior in the documentation. Is this expected behavior or is it a bug? And how can I circumvent this?
from sidekiq-unique-jobs.
Related Issues (20)
- Reaper manager registration is subject to race conditions HOT 1
- Should client middleware also be added to the Sidekiq server config? HOT 2
- After sidekiq shutdown (with running job) lock digest is not pushned back HOT 8
- Returning same job id HOT 7
- Sidekiq 7: Unsupported command argument type: TrueClass HOT 1
- register_reaper_process nx: true crash Sidekiq on startup HOT 2
- uniquejobs:digests sorted set seems to grow forever HOT 2
- should respond to `has_valid_sidekiq_options?` HOT 4
- Compatibility with Sidekiq7 HOT 4
- until_and_while_executing not entering perform method on initial run HOT 7
- No 'Changelog' link is being displayed on https://rubygems.org/gems/sidekiq-unique-jobs HOT 1
- Documentation of lock_ttl is inconsistent HOT 5
- Catched a deadlock on Sidekiq 7+ set up using middleware.
- Conflicts with sidekiq-lock gem HOT 4
- Read Timeouts and high CPU spike after upgrading from 8.0.5 to 8.0.10 HOT 9
- Issue with until_and_while_executing lock when job is not enqueued through sidekiq
- until_and_while_executing with separate server and client lock_args broken since 8.0.8 HOT 3
- Replace MD5 with SHA256+ HOT 2
- lock_prefix argument is not respected
- TypeError ยท Unsupported command argument type: Array HOT 1
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.