abhijeets25012-tech opened a new pull request, #75225: URL: https://github.com/apache/airflow/pull/75225
## Issue #75207: DAG-run duration is incorrect after updating a DAG bundle **Issue:** https://github.com/apache/airflow/issues/75207 ### Description In Apache Airflow 3.3.1, the reported duration of a DAG run can become incorrect when the DAG's bundle version is updated and a task is cleared and rerun. ### Steps to reproduce 1. Run a DAG using bundle version 1 with three tasks: A (3 seconds), B (30 seconds), and C (3 seconds). 2. Update the DAG to bundle version 2. 3. Clear task C and allow it to execute again. 4. Observe the reported DAG-run duration in the Airflow UI. ### Actual behavior The UI reports a DAG-run duration of approximately 3 seconds, excluding the earlier execution period under bundle version 1. ### Expected behavior The DAG-run duration should account for the earlier execution period as well as the rerun, even when task instances execute using different bundle versions. ### Investigation notes The existing implementation calculates `DagRun.duration` from the run's `start_date` and `end_date`. Clearing a finished DAG run resets its `start_date`, which is a potential contributor to the issue. ### Proposed approach - Add a regression test reproducing the bundle-version update and task-clearing scenario. - Identify where the original execution period is lost. - Implement a targeted fix that preserves correct duration reporting without breaking existing task-clearing behavior. - Run the relevant regression and unit tests. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
