-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce usage of redbeat celery task scheduler #393
Conversation
This commit adds celery-redbeat as a dependency of the project and sets it as the default scheduler for celery tasks. Unlike celery-beat, redbeat uses a Redis instance for keeping track of task schedules and uses a distributed mutex lock in order to ensure that only one instance of the scheduler can actually schedule tasks. This comes with the following benefits: * The scheduler can have high availability without compromising scheduling, meaning that we can have e.g. 3 pods of the scheduler running but only one will be actively doing work at any given time, if two Availability Zones happen to go down, the remaining pod will pick up the slack. * The schedule is stored in Redis, meaning that even if there are scheduler restarts, the work to be done can be picked up immediately without delays. * Tasks can be dynamically created/modified. * Faster startup. This commit also simplifies the way that the celery-beat scripts work. Closes OSIDB-1524
bac28e1
to
25f9dc1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the detailed explanation! Makes sense to me and LGTM
|
||
rm -f /tmp/celery_beat.pid | ||
exec celery -A config beat | ||
# Reuse existing standalone version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was the healthy check removed? I don't see it in the standalone version either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's necessary, the celery pods should be able to run independently of the web service as they don't depend on it.
This PR fixes an error while creating a local venv due to a bug in pip. It is also a follow-up to the second commit in #393. For more info, see pypa/pip#9644.
This commit adds celery-redbeat as a dependency of the project and sets it as the default scheduler for celery tasks.
Unlike celery-beat, redbeat uses a Redis instance for keeping track of task schedules and uses a distributed mutex lock in order to ensure that only one instance of the scheduler can actually schedule tasks.
This comes with the following benefits:
This commit also simplifies the way that the celery-beat scripts work.
Closes OSIDB-1524