furiko-io / furiko

Kubernetes cron and batch job platform
https://furiko.io
Apache License 2.0
484 stars 21 forks source link

Enhancement: CronController can avoid back-scheduling for Forbid #51

Open irvinlim opened 2 years ago

irvinlim commented 2 years ago

Since we have updated to use the JobQueueController instead, the process of admitting a Job to be started is now asynchronous. The CronController will back-schedule multiple Jobs even though it should know at this point to just ignore the back-scheduling for ConcurrencyPolicyForbid, because the JobQueueController will just reject them as AdmissionError:

NAME                          AGE   PHASE            CREATED TASKS   RUN TIME   FINISH TIME
jobconfig-sample.1650055799   7s    Succeeded        1                          3s
jobconfig-sample.1650055814   7s    AdmissionError   0                          7s
jobconfig-sample.1650055829   7s    AdmissionError   0                          7s
jobconfig-sample.1650055844   7s    AdmissionError   0                          7s
jobconfig-sample.1650055859   7s    AdmissionError   0                          7s

In case users set a high back-scheduling limit, this may result in huge bursts of unnecessary Job creation.