This repository has been archived by the owner on Aug 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
Race conditions throw by mongodb #77
Comments
In fact, beat sync every 180s by default, doing this, you need to wait 3min before taking into acount new schedules, that's not statisfying... Still testing why I take Race conditions. |
I've added in schedulers.py:
To handle timezone because mongodb give last_run_at with UTC timezone, while celery beat look for local timezone which is not the same. This works with celery 5 using the config key timezone when loading celery |
The race conditions appears when sync come from beat in the same time we sync from beatmongo |
To fix this quickly, I just changed to this :
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
I got Race conditions errors, and sometimes, when I edit a schedule, bunch of other tasks are executed without respecting their schedules.
Reading the code, I think it could be optimized but I'm not sure enough, I post it here if someone reads me ;)
We have this in MongoSchedulers:
While in beat.py from celery, at each tick, we verify difference between previous schedule and new one, so we trigger a get_from_database quiet often because the require_upates refresh every 5sec, the same as tick time interval.
So every 5 sec, we sync, we fetch from database, and once finished, we look if we need to sync again and probably we do.
So we could let beat.py :
decide if we should sync :
I need to test it.
The text was updated successfully, but these errors were encountered: