Kubernetes CronJob Overlapping Runs - Fix concurrencyPolicy in CI
A CronJob’s concurrencyPolicy decides what happens when a new scheduled run is due while a previous one is still active. The default Allow lets runs overlap; Forbid skips the new run; Replace cancels the old one.
What this error means
Either many Jobs from the same CronJob run at once and contend for the same resource (with Allow), or scheduled runs silently do not start because a long previous run is still active (with Forbid). The behavior is consistent with whichever policy is set.
# Allow (default): runs stack up
$ kubectl get jobs -l job-name
backup-28.... Running
backup-28.... Running # previous run never finished, now two overlap
# Forbid: new run skipped
Cannot determine if job needs to be started: Too many missed start timesCommon causes
Default Allow lets slow runs overlap
With concurrencyPolicy: Allow, a run that outlasts its schedule interval overlaps the next invocation, doubling load on a shared database or lock.
Forbid silently skips while a run is active
With Forbid, if a previous Job is still running at the next scheduled time, the new run is skipped rather than queued - which can look like the CronJob "stopped firing".
How to fix it
Pick the policy that matches the workload
Choose explicitly instead of relying on the Allow default.
spec:
concurrencyPolicy: Forbid # skip if the previous run is still active
# or Replace to cancel the running one and start fresh
# or Allow to permit overlapBound run time and inspect history
- Set
activeDeadlineSecondson the Job template so a hung run cannot block future runs forever underForbid. - Raise
startingDeadlineSecondsif "Too many missed start times" appears after the controller was paused. - Check
successfulJobsHistoryLimit/failedJobsHistoryLimitso old Jobs are reaped.
How to prevent it
- Set
concurrencyPolicyexplicitly per CronJob instead of inheritingAllow. - Bound each run with
activeDeadlineSecondsso it cannot block the schedule. - Keep run time well under the schedule interval to avoid overlap entirely.