Skip to content

Enforce execution_timeout during task deferrals#69679

Open
KushagraB424 wants to merge 1 commit into
apache:mainfrom
KushagraB424:fix-execution-timeout-deferral
Open

Enforce execution_timeout during task deferrals#69679
KushagraB424 wants to merge 1 commit into
apache:mainfrom
KushagraB424:fix-execution-timeout-deferral

Conversation

@KushagraB424

Copy link
Copy Markdown
Contributor

When a task instance updates its state to DEFERRED via the Execution API, the system only recorded the trigger_timeout, but failed to enforce the task's overall execution_timeout.

This PR fixes this by:

  1. Adding execution_timeout to the TIDeferredStatePayload schema.
  2. Updating the Task SDK to compute and pass the ti.task.execution_timeout in the DeferTask payload.
  3. Updating the Execution API ti_update_state route to compute the absolute execution timeout ceiling limit (ti.start_date + execution_timeout) and store the minimum of the trigger_timeout and execution_timeout.
  4. Updating task_runner.py to also deduct time already spent when local execution resumes, ensuring that time limits apply properly across deferral gaps.

closes: #69678


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Google DeepMind Antigravity IDE following the guidelines

When a task updates its state to DEFERRED, it only enforced the trigger_timeout. This updates the Execution API to also enforce the execution_timeout constraint when scheduling the deferred task.
@boring-cyborg boring-cyborg Bot added area:API Airflow's REST/HTTP API area:task-sdk labels Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:task-sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Execution API: Task deferrals do not enforce execution_timeout

1 participant