Comments (7)
Here's my temp fix until this gets merged into a packaged version:
In package myredbeat
in schedulers.py
:
class MyBeatConfig(redbeat.schedulers.RedBeatConfig):
# Override the RedBeatConfig because it won't allow self.lock_key = None even though it's valid
# See https://github.com/sibson/redbeat/issues/101 and https://github.com/sibson/redbeat/pull/109
def __init__(self, app=None, single=False):
super(MyBeatConfig, self).__init__(app)
if single:
self.lock_key = None
celery_app = celery.Celery("...")
celery_app.redbeat_conf = myredbeat.schedulers.MyBeatConfig(celery_app, single=False)
from redbeat.
If the PR for the fix isn't going to be merged soon (it's been stale for a while and there are merge conflicts, so I'm guessing it won't be in the very near future) the docs should be updated to either remove references to this feature or note that it's a known issue and document any workarounds. (I'm happy to submit a PR, if it'll be considered.)
I'm seeing an issue where the lock isn't released when Redis/Celery (both 4 and 5) shut down and I'm having to manually remove either keys or the Redis DB in order to get the lock released -- this is especially problematic in my development environment. I suppose I could script that process as part of my application's bootstrap phase, but that feels heavy-handed. (I'd also like to figure out why the lock isn't being automatically released, but haven't had a chance to dig into that yet.) My setup is simple enough that I may just revert to a file-based schedule until I can either figure out the root cause of the persistent lock or this feature gets re-introduced.
UPDATE:
I'm just confirming that @jscaria's solution works for me. If the docs are updated, it should be included and/or this issue should be referenced.
from redbeat.
@jscaria Your solution looks promising but It's not working for me. I'm getting 'app does not have an attribute redbeat_conf' which actually makes sense. Any idea?
from redbeat.
@jscaria Your solution looks promising but It's not working for me. I'm getting 'app does not have an attribute redbeat_conf' which actually makes sense. Any idea?
I missed the part of overriding ensure_conf
in myredbeat.schedulers
. I haven't tested this recently but a quick glance suggests that's probably the issue.
from redbeat.
I'm open to accepting a doc fix or merging #206 if that delivers the correct behaviour.
from redbeat.
This is still an issue. Is there a strong preference here between the approach in #109 and #206? Additionally, what would be needed to get a fix across the finish line?
from redbeat.
I'm not seeing anything obvious jump out as reasons to prefer #109 or #206? If #206 merges cleanly and #109 doesn't then I'll go with #206 . Does anyone else see a reason to prefer one over the other? If someone can confirm the PR solves the problem for them I'll merge it.
from redbeat.
Related Issues (20)
- New release? HOT 7
- The scheduler may publish task when acquiring the lock failure HOT 1
- Unable to Schedule Different Timezone per different task
- Celery 5.3.0rc1 not useable with redbeat anymore. HOT 3
- Redbeat doesn't work with celery 5.3.0 HOT 2
- Updated to 2.1.1 from 2.0.0 now it fails to run. HOT 6
- Retry did not work after (104, 'Connection reset by peer')
- The distributed lock set to None failed HOT 3
- Support for limit run option to avoid delay tasks that previous not finished
- tzinfo utcoffset taking None as parameter
- NoneType object has no attribute total_seconds
- RedisCluster is on EOL HOT 1
- [Question] Ensuring task is scheduled HOT 1
- Cannot import FixedOffset when running with celery>5.2.7
- New bugfix release HOT 2
- redis_url is not recognized HOT 3
- Conda packages for version higher than 2.0.0 HOT 1
- Usual way of defining periodic tasks in celery not working as expected
- High Availability?
- Different Application sharing same redis instance
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 redbeat.