Make minimum job age configurable
gustaff-weldon opened this issue · comments
According to @gabriel-samfira
There is a loop that checks every 5 seconds for recorded queued jobs. Jobs that are newer that 30 seconds are ignored, to allow any existing idle runners to pick up the job. After that, a new runner is spun up and the job is "locked" so the loop ignores it
It would be useful, if that 30s limit could be configured, so jobs are picked sooner if needed. In our use case our pools run with minRunners: 0
and we rely only on GARM, so it introduces unnecessary delay with spawning the runner.
Give #274 a shot and let me know if it works for you. To set the backoff interval, you can use:
garm-cli controller update --minimum-job-age-backoff=0
I'd recommend you set at least 5 seconds for the backoff. If you have multiple hierarchy levels configured (repo, org, enterprise), webhooks will not come in simultaneously for each of the entities.
The timeout would allow all webhooks to come in before trying to consume queued jobs. So multiple entities will get a chance to create a runner for a job.