Open christad92 opened 2 months ago
I'd say we need two things here, almost certainly separate issues. Something around: https://github.com/OpenFn/lightning/blob/main/lib/lightning/runs/queue.ex#L12
Artificially limit (or increase?) the number of runs being excecuted at once per project (concurrency dial, just like v1). Something like...?
i'm the worker, give me runs to execute...
WHERE NOT IN runs.state == executing AND runs.project_id IN (
some sort of list of projects?
)
Artificially add a "cool-down" to stall, per project, after each run. Something like...?
i'm the worker, give me runs to execute...
WHERE NOT IN min(age(now(), runs.finished_at)) > '10 seconds' AND runs.project_id IN (
some sort of list of projects?
)
Nice blog that @stuartc found - https://docs.hatchet.run/blog/multi-tenant-queues#introducing-concurrency-limits
And here's the UI from v1:
Stu is yet to spike the approach to implementing this. cc: @stuartc
Configurable concurrency is a mechanism that allows us to restrict how many workflows/jobs the worker can run in parallel within a project. When concurrency is set to 1, only a work order/run/job can be processed at a time and other jobs will be enqueued until that is done.
How this worked in v1
TODOs:
Acceptance Criteria
Questions: