Skip to content

Commit b6e815b

Browse files
authored
Merge pull request #33536 from alculquicondor/job-failures
Accurate explanation for the calculation of number of failures in Job
2 parents a7c6e4d + 63272f9 commit b6e815b

File tree

1 file changed

+14
-4
lines changed
  • content/en/docs/concepts/workloads/controllers

1 file changed

+14
-4
lines changed

content/en/docs/concepts/workloads/controllers/job.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,19 @@ due to a logical error in configuration etc.
253253
To do so, set `.spec.backoffLimit` to specify the number of retries before
254254
considering a Job as failed. The back-off limit is set by default to 6. Failed
255255
Pods associated with the Job are recreated by the Job controller with an
256-
exponential back-off delay (10s, 20s, 40s ...) capped at six minutes. The
257-
back-off count is reset when a Job's Pod is deleted or successful without any
258-
other Pods for the Job failing around that time.
256+
exponential back-off delay (10s, 20s, 40s ...) capped at six minutes.
257+
258+
The number of retries is calculated in two ways:
259+
- The number of Pods with `.status.phase = "Failed"`.
260+
- When using `restartPolicy = "OnFailure"`, the number of retries in all the
261+
containers of Pods with `.status.phase` equal to `Pending` or `Running`.
262+
263+
If either of the calculations reaches the `.spec.backoffLimit`, the Job is
264+
considered failed.
265+
266+
When the [`JobTrackingWithFinalizers`](#job-tracking-with-finalizers) feature is
267+
disabled, the number of failed Pods is only based on Pods that are still present
268+
in the API.
259269

260270
{{< note >}}
261271
If your job has `restartPolicy = "OnFailure"`, keep in mind that your Pod running the Job
@@ -405,7 +415,7 @@ The pattern names are also links to examples and more detailed description.
405415
| ----------------------------------------- |:-----------------:|:---------------------------:|:-------------------:|
406416
| [Queue with Pod Per Work Item] | ✓ | | sometimes |
407417
| [Queue with Variable Pod Count] | ✓ | ✓ | |
408-
| [Indexed Job with Static Work Assignment] | ✓ | | ✓ |
418+
| [Indexed Job with Static Work Assignment] | ✓ | | ✓ |
409419
| [Job Template Expansion] | | | ✓ |
410420

411421
When you specify completions with `.spec.completions`, each Pod created by the Job controller

0 commit comments

Comments
 (0)