Skip to content

Reject invalid TaskInstance state update payloads#67160

Open
henry3260 wants to merge 1 commit into
apache:mainfrom
henry3260:fix-execution-api-invalid-ti-state-payloads
Open

Reject invalid TaskInstance state update payloads#67160
henry3260 wants to merge 1 commit into
apache:mainfrom
henry3260:fix-execution-api-invalid-ti-state-payloads

Conversation

@henry3260
Copy link
Copy Markdown
Contributor

Why

I found The Execution API /execution/task-instances/{task_instance_id}/state endpoint previously exposed a catch-all TaskInstance state payload schema that allowed scheduler/executor- owned states such as scheduled, queued, and restarting.

Those states are not valid worker-reported execution outcomes for this endpoint. Since the route implementation does not handle them, sending one could fall through to an error path and potentially mark a running task as failed instead of rejecting the invalid payload.

we should block them in schema stage and return 422, we may not want them to change to FAIL


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

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@boring-cyborg boring-cyborg Bot added area:API Airflow's REST/HTTP API area:task-sdk labels May 19, 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.

1 participant