-
-
Notifications
You must be signed in to change notification settings - Fork 296
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
Fix scheduler concurrency with multiple clusters #347
Conversation
Codecov Report
@@ Coverage Diff @@
## master #347 +/- ##
======================================
Coverage 90.4% 90.4%
======================================
Files 43 43
Lines 2846 2846
======================================
Hits 2573 2573
Misses 273 273
Continue to review full report at Codecov.
|
@maerteijn Thanks for prepping this! I think it will make it possible for me to run in e.g. an AWS Auto Scaling group where I have 2-N servers all running |
Yes and yes 😃 |
@maerteijn Thanks! I experimented a bit with your branch and so far no duplicate tasks while running clusters on 4 separate servers :) |
Broke this PR by fixing the Arrow issue. If you could change the 'replace' to 'shift' in your code, we should be good. |
Ok, I’ll try to fix this soon(ish) |
I updated the pull request |
This pull request fixes two issues:
Prevents that the Sentinel is running the Scheduler on startup (even when we added
scheduler: False
to the configuration).Lock the selected rows with
select_for_update
when creating tasks from Scheduler items. This makes sure that tasks are created only once (fixes scheduler creating duplicate tasks in multiple cluster environment #231). I tested this with PostgreSQL and MySQL.