﻿# Bound the entire batch job rather than one process attempt

Place the deadline at Job scope and distinguish elapsed-time failure from retry count, suspension and output validity.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/guide-ks-job-active-deadline/
Language: en

A batch model keeps retrying failed Pods until its useful processing window has passed. A per-process timeout cannot bound that entire sequence. The Job-level activeDeadlineSeconds applies to the Job across its Pods, so the overall retry policy needs an elapsed-time boundary as well as a failure-count boundary.

## Locate the actual field

Inspect the Job's spec rather than assuming a similarly named Pod-template field has the same scope. Job and Pod specifications both expose activeDeadlineSeconds. A Pod deadline bounds that Pod; the Job deadline governs the overall Job lifecycle. Preserve the field path in reviews so an apparently reasonable value is not attached to the wrong object.

## Include preparation and retries

Build the useful budget from the observed Job timeline, including placement delays, image preparation, artifact loading and failed attempts where they occur in that lifecycle. Do not size it from kernel execution alone. A Job with no useful output can still spend its available interval waiting for resources or repeating initialization after each failure.

## Read precedence and termination

The Job active deadline takes precedence over backoffLimit. Reaching the elapsed-time boundary stops further retries and triggers termination of running Pods even if the retry count remains below its limit. Observe the failure reason and Pod termination separately. The decision time is not a promise that every process and external dependency stops at exactly that instant.

## Account for suspension semantics

Documented Job suspension and resumption affect startTime and the active deadline timer. If an external workflow pauses Jobs, do not interpret the field as an immutable wall-clock deadline from original object creation. A business cutoff may require separate orchestration logic. Keep that requirement explicit rather than assuming every lifecycle pause consumes the same budget.

## Test partial-output handling

Use a tiny job that intentionally exceeds its deadline after producing a temporary result. Verify the Job condition, absence of further controller retries and the application's treatment of incomplete output. A failed Job is not automatically restarted as a new Job. The deadline bounds controller-managed work; it does not roll back writes or establish that partial inference results are safe to consume.

## Primary references

[Kubernetes Jobs](https://kubernetes.io/docs/concepts/workloads/controllers/job/).

[Job API](https://kubernetes.io/docs/reference/kubernetes-api/batch/job-v1/).

[Kubernetes Pod Lifecycle](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/).

Related reading: [Request deadlines: budgeting queueing, prefill and streaming](/journal/provider-request-deadline-stage-budget/); [Retrying generation POSTs: idempotency must be explicit](/journal/provider-post-retry-idempotency-ledger/).
