Skip to content
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

Allow multiple schedulers to run #104

Merged
merged 1 commit into from
Feb 3, 2017
Merged

Conversation

cheungpat
Copy link
Contributor

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 #70

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
@selwin
Copy link
Collaborator

selwin commented Dec 24, 2015

Thanks for the PR!

I'd like to keep register_birth to keep track of when the active scheduler instance taking over so could you please use a different key for lock acquisition purposes?

For backward compatibility reasons, rq-scheduler should still raise an exception if it fails to acquire a lock. The new behaviour should only kick in if the user specifies scheduler.run(retry_lock=n), with (-1) means retry for an infinite amount of time.

Better naming suggestion welcome :)

@selwin
Copy link
Collaborator

selwin commented May 5, 2016

@cheungpat reminder to update this Pr when you have the time :)

henrythe9th added a commit to henrythe9th/rq-scheduler that referenced this pull request Sep 1, 2016
maurodoglio pushed a commit to maurodoglio/rq-scheduler that referenced this pull request Sep 16, 2016
maurodoglio pushed a commit to maurodoglio/rq-scheduler that referenced this pull request Sep 16, 2016
maurodoglio pushed a commit to maurodoglio/rq-scheduler that referenced this pull request Sep 19, 2016
@marcinn
Copy link
Contributor

marcinn commented Jan 20, 2017

@selwin @cheungpat - any chances to finish this PR and merge into upstream? I'm building a failover in one of my project and RQ Scheduler is currently a SPOF. I can use external tool like Heartbeat, of course, but the possibility to make RQ Scheduler fault tolerant without external tools is attractive and simpler in terms of overall architecture.

Can I help you somehow with this PR?

@selwin
Copy link
Collaborator

selwin commented Jan 20, 2017

@marcinn if you can take care of the merge conflicts, please do so and submit another PR :)

@marcinn marcinn mentioned this pull request Jan 20, 2017
@selwin selwin merged commit 7e13092 into rq:master Feb 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants