Skip to content

Standardize task run state conflict error response#69981

Open
fat-catTW wants to merge 1 commit into
apache:mainfrom
fat-catTW:fix-ti-run-problem-detail
Open

Standardize task run state conflict error response#69981
fat-catTW wants to merge 1 commit into
apache:mainfrom
fat-catTW:fix-ti-run-problem-detail

Conversation

@fat-catTW

Copy link
Copy Markdown
Contributor

Update the Execution API response for task run state conflicts to use RFC 9457-style problem detail fields.

The response still keeps Airflow-specific fields like reason and previous_state, so clients can continue using machine-readable context while receiving a more standard error shape.

Updated the related API, Task SDK client, and supervisor tests to match the new response payload.

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

Generated-by: [Codex] following the guidelines


  • 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 Jul 16, 2026
"type": "about:blank",
"title": "Conflict",
"status": status.HTTP_409_CONFLICT,
"detail": "TI was not in a state where it could be marked as running",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not really match RFC 9457. It will create a nested response like this:
(since HTTPException is used here)

{
  "status_code": 409,
  "detail": {
    "type": "about:blank",
    "title": "Conflict",
    "status": 409,
    "detail": "TI was not ..."
  }
}

@Andrushika

Andrushika commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Hi! Please make sure every breaking change in the execution API has a corresponding Cadwyn migration. (Please follow contributing-docs/19_execution_api_versioning.rst)

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.

2 participants