-
-
Notifications
You must be signed in to change notification settings - Fork 230
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
Architecture question: Multiple rqscheduler processes? #70
Comments
These is a similar bug open here: #62 The way I solved this was by making my own rqscheduler script (I already need to subclass
Then I run my It would be nice to see this behavior builtin to rq-scheduler, as I explained in this comment: #62 (comment) |
Yes, let's build this into |
@darkpixel has an interesting suggestion. Allow multiple schedulers to run, but each scheduler has to acquire a lock when scheduling jobs. I think this is a good solution to people who want to run multiple scheduler processes for reliability purposes. If someone can make a pull request for this, I would be happy to accept this :) |
If a redis lock is used, how to ensure that a crashed scheduler doesn't cause a stale lock? Maybe a simple keep alive via redis pub/sub?
|
We can use "redis.expire(30)" so that if scheduler crashes, the lock will still be expired by Redis :) Sent from my phone
|
Ah, that works. A deadman switch.
|
Schedulers have to acquire a lock before one can schedule jobs. The lock automatically expires in case a scheduler is terminated unexpectedly. Schedulers that cannot acquire a lock will sleep for the duration of polling interval before retrying. refs rq#70
I was wondering if this product has some built in ability to deal with multiple scheduler processes?
In the case of RQ workers distributed across multiple hosts with clustered Redis, one would have a pretty fault tolerant system, for example if a whole machine goes down - jobs still get processed.
If however, some of these jobs are scheduled jobs and the particular host goes down that was running the scheduler... scheduled jobs would then not get run until another schedule was started (jobs are recovered at least).
But what about running multiple schedulers? Thus a highly available system.
The text was updated successfully, but these errors were encountered: