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

Multi schedulers #143

Merged
merged 3 commits into from
Feb 3, 2017
Merged

Multi schedulers #143

merged 3 commits into from
Feb 3, 2017

Conversation

marcinn
Copy link
Contributor

@marcinn marcinn commented Jan 20, 2017

Here is an updated PR for multiple schedulers support (GH-104).

refs #70

cheungpat and others added 2 commits December 12, 2015 17:59
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 Jan 20, 2017

@marcinn could you please restore register_birth() and register_death()? register_birth() should still be called after lock is acquired and register_death() called when scheduler stops.

@marcinn
Copy link
Contributor Author

marcinn commented Jan 20, 2017

OK, I'll look at this. I've just resolved the conflict without looking at birth/death.

@marcinn
Copy link
Contributor Author

marcinn commented Jan 23, 2017

@selwin I'm thinking over and over again about scheduler locking and I'm not sure about current implementation. The lock is acquired in the loop and stays acquired until end of the work. So in non-burst mode it will be locked constantly, even during sleeping.

Maybe the lock should be released before scheduler is going to sleep? It would allow other long-running schedulers to run. The one risk I see relies in not synced clocks between hosts running the scheduler, where each instance may enqueue too many jobs.

What do you think?

@selwin
Copy link
Collaborator

selwin commented Feb 3, 2017

@marcinn I see your point. However, I'm more inclined to leave it as it now.

People mostly request this feature for redundancy reasons. If a scheduler releases its lock everytime it goes to sleep, people with multiple schedulers will have many schedulers firing off at random times, which is not what we want.

@selwin selwin merged commit f81042e into rq:master Feb 3, 2017
@marcinn
Copy link
Contributor Author

marcinn commented Feb 3, 2017

Thank you, @selwin

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