Comments (1)
However if the worker just started, last_cleaned_at is None and should_run_maintenance_tasks returns True immediately. This could cause should_run_maintenance_tasks to return True too quickly if workers are short-lived
👉 Why not store last_cleaned_at as a redis key with the worker id as prefix?
I stored this as a local worker attribute so we can eliminate an extra Redis call everytime this is checked (if you have many short lived jobs, workers will perform an extra Redis call everytime they finish). But I think your suggestion is correct, we can also add a Redis key that's shared across all workers.
the maintenance task runs the clean_registries method which takes a lock on queues. However the lock is implemented in a strange way, it's a simple redis key rq:clean_registries:%s with a TTL of 899, but it's never deleted. So the clean_registries cannot run more often than 899 sec, even if the maintenance_interval is smaller
👉 Why not delete the lock once the maintenance task has been done?
The lock should be deleted once maintenance task is finished. Mind opening a PR for this?
from rq.
Related Issues (20)
- Some strange error in Python code in Docker container running RQ
- Machine learning models are forced to use single thread
- how to have a queue across two (or more) workers but still runs functions in sequence? HOT 3
- Worker starts twice if queue isn't empty
- fatal rq error HOT 4
- Python Redis Queue: job is finished but result is None HOT 1
- OpenTelemetry tracing HOT 3
- Don't call cleanup from count and get_job_id
- redis.exceptions.ResponseError: Command # 1 (SADD rq:queues rq:queue:test) of pipeline caused error: MOVED 8713 mxxx.euw1.cache.amazonaws.com:6379 HOT 1
- Dependencies specified with Dependency(allow_failure=True) are never enqueued when a job is moved to FailedJobRegistry due to AbandonedJobError
- Can we pass custom args to a callback (on_failure) HOT 2
- Worker rq:worker:... found an unhandled exception, quitting (ModuleNotFoundError: No module named 'resource') HOT 5
- Jobs being lost when killing workers HOT 2
- Use RedisCluster as connection argument for rq worker (redis 5.0.1, rq 1.15.1) HOT 17
- Make registry cleaning lock expiry configurable HOT 2
- Programmatically create more workers at run-time by using Django_rq
- Seg fault 11 on setprocname HOT 1
- execute code with workhorse PID after the workhorse exits HOT 1
- ValueError: Invalid attribute name for job callback 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 rq.