Repository navigation
Surface the retry policy decision on task instances page - #73030
Conversation
bbovenzi
left a comment
There was a problem hiding this comment.
LGTM UI-wise. I may play with the placement of the state reason more once I use this more.
|
Approving. The masking now happens in the worker, where the secret is registered, and the items from the earlier rounds are all in. Nothing below needs to hold the merge.
|
|
Thanks, folks. Did the last 3.
On schedule_tis: good catch, and worse than the cases we already knew about, since the counts and the reason come from different attempts rather than just being stale. Taking it into the clearing follow up alongside |
|
Yea the failing checks aren't related. Merging. |
Backport failed to create: airflow-ctl/v0-1-test. View the failure log Run detailsNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
You can attempt to backport this manually by running: cherry_picker 8b3d4d3 airflow-ctl/v0-1-testThis should apply the commit to the airflow-ctl/v0-1-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
Was generative AI tooling used to co-author this PR?
What
A retry policy can already classify why a task failed (auth error, rate limit, and so on), and #73027 makes sure that reason is actually saved to the database on the failure path, not just the retry path. But that reason still isn't visible anywhere - not through the API, not in the UI. This PR closes that gap: it exposes
retry_reasonthrough the public REST API and renders it on the Task Instance page, so a Dag author looking at a failed task can finally see a plain-English reason instead of just "FAILED" with no explanation. Stacked stacked on #73027.Current behaviour
retry_reasonis a real column on bothtask_instanceandtask_instance_history(written by #73027), but neither the public REST API'sTaskInstanceResponse/TaskInstanceHistoryResponsemodels nor the Task Instance UI expose it. The data sits in the database with no way to see it.Proposed change
Backend (core API):
retry_reason: str | None = Noneto bothTaskInstanceResponseandTaskInstanceHistoryResponse(airflow-core/src/airflow/api_fastapi/core_api/datamodels/). Both models needed the field - the Task Instance page's per try data comes from thetry-detailsendpoint, which returnsTaskInstanceHistoryResponsebacked by either the live row or an archived history row.GET .../taskInstances/{task_id}andGET .../tries/{try_number}already return the ORM object directly, so FastAPI/Pydantic auto-maps the existingretry_reasoncolumn.airflow-ctl's generated datamodels via their respective hooks (never hand-edited).Frontend (
Details.tsx, the Task Instance details page):Alertsystem-component (the same oneWarningAlert/ErrorAlertuse), so it's visually consistent with how errors are already surfaced elsewhere in the UI.taskInstance.retryReason: "Reason for state"); other locales fall back to English until translated separately, since the i18n validity check doesn't enforce cross-locale key parity.Testing
Ran the same
example_llm_retry_policydag.Task that fails:
Task in retry state:

And when it moves to failed:
{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.