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

Extend documentation of concurrency controls #502

Open
cedricpim opened this issue Jan 29, 2025 · 1 comment
Open

Extend documentation of concurrency controls #502

cedricpim opened this issue Jan 29, 2025 · 1 comment

Comments

@cedricpim
Copy link

Hello 👋

I had a usage for concurrency controls and I was investigating how it worked and I found two pieces of information that I think could be useful in the README section because they weren't immediately clear to me.

The first piece was that the dispatcher, only releases one job with duration expired per run (so, using the default value of 5 minutes for concurrency_maintenance_interval, it means only one expired job is released every 5 minutes).

The second piece of information was that, on a job (with concurrency controls) completion, the duration of the already blocked jobs is "refreshed" (from what I was able to see, this happens because the concurrency keys to be considered for release must either have an open semaphore or no semaphore at all and, since dispatcher destroys expired semaphores, when a job finishes, the semaphore expiration time is increased).

Let me know if you want me to prepare a PR or you prefer to write this on your own words (or if I am wrong of course).

@rosa
Copy link
Member

rosa commented Feb 3, 2025

Hey @cedricpim, sure! Feel free to open a PR with some changes to the README.

The first piece was that the dispatcher, only releases one job with duration expired per run

One per concurrency key, to ensure concurrency limits are still respected for the released jobs. In theory, this shouldn't need to release any jobs unless you have a job that is very long, as jobs should release the following blocked jobs when they finish, but of course, there's a race condition here: #456. This means the dispatcher's concurrency maintenance fallback is necessary in that case until I fix that 😳 (it's a tricky one).

on a job (with concurrency controls) completion, the duration of the already blocked jobs is "refreshed"

Do you mean if a job finishes and un-blocks another job, then the new job renews the semaphore expiry time? Then yes, that's correct 👍

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

No branches or pull requests

2 participants