You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "manoj121999 (via GitHub)" <gi...@apache.org> on 2026/08/28 05:34:41 UTC

[PR] Show retry timing details in task instance UI [airflow]

manoj121999 opened a new pull request, #72184:
URL: https://github.com/apache/airflow/pull/72184

   Retry waits can otherwise look like scheduler or executor delays, making expected backoff and jitter difficult to distinguish from operational latency.
   
   This PR makes the retry calculation visible in Task Instance details while the current attempt is in `up_for_retry`.
   
   ### What changes
   
   - Display the next eligible retry time and final calculated delay.
   - Show the configured delay, exponential-backoff delay, deterministic jitter, effective maximum delay, and whether the delay was capped.
   - Show retry-policy context when a retry policy overrides the task configuration.
   - Add read-only REST API endpoints for retrieving retry details for mapped and unmapped task instances.
   - Return retry details only while a task instance is waiting for retry; otherwise, return `409 Conflict`.
   - Regenerate the OpenAPI specification, UI client, AirflowCTL models, and API permission reference.
   - Add backend, API, and UI tests covering task-configured retries, retry-policy overrides, capped delays, mapped task instances, permissions, and error responses.
   
   ### How it works
   
   `TaskInstance.get_retry_timing()` exposes the components of the retry calculation already used by Airflow. `next_retry_datetime()` continues to return the eligible retry time from that same calculation.
   
   The API loads the task definition from the Dag version associated with the run and calculates the details on demand. The UI requests them only for the current attempt while its state is `up_for_retry`.
   
   ### Compatibility
   
   This is an additive, visibility-only change:
   
   - It does not change retry scheduling, jitter generation, or scheduler/executor behavior.
   - It does not modify existing API response schemas.
   - It does not add a database migration, configuration option, or dependency.
   - It does not persist retry calculations. Historical attempts therefore do not display this breakdown.
   
   ### UI
   
   #### Before
   Without any details of Jitter
   
   1st retry ended at 10:37
   <img width="800" height="458" alt="image" src="https://github.com/user-attachments/assets/eb956739-e962-4548-9b98-210907de09f7" />
   
   2nd retry started at 10:42
   <img width="699" height="486" alt="image" src="https://github.com/user-attachments/assets/8a2480d8-a9ab-4e8a-9f1a-d3007c55fcb2" />
   
   
   <img width="515" height="147" alt="image" src="https://github.com/user-attachments/assets/24f18279-7253-468a-944d-5b6ca16a6222" />
   
   
   #### After
   With jitter detials added.
   
   <img width="515" height="147" alt="image" src="https://github.com/user-attachments/assets/000e9042-e821-4564-89ef-ebf12655f9f5" />
   
   <img width="1475" height="445" alt="image" src="https://github.com/user-attachments/assets/66d6ef34-0a0b-4d97-8075-1fcaa4a19de0" />
   
   
   ### Testing
   
   - Airflow commit and manual `prek` checks, including mypy, Ruff, API generation, and the production UI build.
   - Backend/API tests:
   
     `breeze run pytest airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_task_instances.py airflow-core/tests/unit/models/test_taskinstance.py -xvs`
   
   - UI tests:
   
     `corepack pnpm vitest run src/pages/TaskInstance/Details.test.tsx src/pages/TaskInstance/RetryDetails.test.tsx`
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — OpenAI Codex (GPT-5)
   
   Generated-by: OpenAI Codex (GPT-5) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   
   ---
   
   * Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#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](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
   * When adding a dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   * For significant user-facing changes, create a newsfragment in [airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
   
   ---
   Drafted-by: OpenAI Codex (GPT-5); reviewed by @manoj121999 before posting


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Show retry timing details in task instance UI [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun closed pull request #72184: Show retry timing details in task instance UI
URL: https://github.com/apache/airflow/pull/72184


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Show retry timing details in task instance UI [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #72184:
URL: https://github.com/apache/airflow/pull/72184#issuecomment-5448858661

   Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our [Contributors' Guide](https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
   Here are some useful points:
   - Pay attention to the quality of your code (ruff, mypy and type annotations). Our [prek-hooks]( https://github.com/apache/airflow/blob/main/contributing-docs/08_static_code_checks.rst#prerequisites-for-prek-hooks) will help you with that.
   - In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/main/airflow-core/docs/howto/custom-operator.rst) Consider adding an example Dag that shows how users should use it.
   - Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/dev/breeze/doc/README.rst) for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
   - Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
   - Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
   - Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#coding-style-and-best-practices).
   - Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
   Apache Airflow is a community-driven project and together we are making it better 🚀.
   In case of doubts contact the developers at:
   Mailing List: dev@airflow.apache.org
   Slack: https://s.apache.org/airflow-slack
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org