SIGN IN SIGN UP
apache / airflow UNCLAIMED

Apache Airflow - A platform to programmatically author, schedule, and monitor workflows

0 0 267 Python

Enforce execution_timeout in deferrable KubernetesPodOperator (#67229)

Compute the deadline operator-side from ti.start_date + execution_timeout
and plumb it to KubernetesPodTrigger via trigger_kwargs["_execution_deadline"]
(an existing dict already accepted and serialized by every subclass) so
the trigger can short-circuit and emit its own status="timeout" event.
This routes timeout through trigger_reentry → _clean() → pod deletion +
final log capture, matching the success/failure event path.

defer.timeout is set to the remaining budget with a 60s minimum so the
trigger has runway to emit its own timeout event before the framework
backstop fires (which would otherwise short-circuit to TaskDeferralTimeout
and skip the operator's cleanup).

Following the leading-underscore convention established by _redefer_count
in the same file: trigger_kwargs is the only existing operator -> trigger
plumbing that's a generic, untyped, dict-shaped, fully-serialized bag and
already accepted by every KubernetesPodTrigger subclass. Using it avoids
adding a new __init__ kwarg or serialize() field on KubernetesPodTrigger,
keeping cross-version compatibility with subclasses (e.g. EksPodTrigger,
GKEStartPodTrigger) released independently.

Closes: #67227

Co-authored-by: Cursor <cursoragent@cursor.com>
P
Paul Mathew committed
3d3e79d8c848b8ba7985ecd6a7b2d9a9990a67fd
Parent: 12e3355
Committed by GitHub <noreply@github.com> on 5/30/2026, 6:21:08 PM