-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Add support to prevent overlapping execution of cron tasks #7989
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
Conversation
|
Should this fail instead of wait for the lock? If the task has an issue, won't the schedule create a backlog of tasks to run one after the other? I'm not very familiar with the scheduler wrapper to know if does something else. |
|
Yeah I used an exclusive lock for docker-local. Kubernetes might start containers though if the old one finishes within the timeout (though I intend to increase the timeout to allow for better autoscaling). |
|
Is there anything I can do to help with this? I don't know how to create test cases for these, but I can try if needed. |
|
Yeah the next thing is to add a test that does something like |
|
I wrote a test for this, but I couldn't get it to fail. Noticed a few things:
I don't know what's wrong or why I can't seem to affect the test. |
|
I don't know what's missing in the test :(. |
|
I haven't taken a look but we should probably That would help in figuring out if the container has the expected labels. Also, run the second app container with |
4db5d58 to
8024ae7
Compare
Also add some validation to ensure invalid values are not specified.
8024ae7 to
8c2731b
Compare
|
Looks like the concurrency policy attached is |
|
Ah the problem is that we release the lock basically immediately due to using |
…s forbid We cannot grab a lock as cron:run with --detach will release the lock. Instead, just check if any containers for the specified cron_id are running and exit.
|
There were a few small bugs but I think I've squashed them and the tests should pass now :) |
|
I also need to see if we can force the concurrency for |
Closes #7988