You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jobs@airflow.apache.org by GitBox <gi...@apache.org> on 2026/04/06 22:57:16 UTC

[GH] (airflow/fix/reschedule-start-date-restoration): Workflow run "Check newsfragment PR number" failed!

The GitHub Actions job "Check newsfragment PR number" on airflow.git/fix/reschedule-start-date-restoration has failed.
Run started by GitHub user peachchen0716 (triggered by peachchen0716).

Head commit for run:
20096b17a17f41e14a6350159f83b5256c6d1f28 / Arthur Chen <ar...@linkedin.com>
Fix start_date not restored for rescheduled tasks when scheduler queues them

In _check_and_change_state_before_execution, the code that restores
TaskInstance.start_date to the original first-poke time was gated on
ti.state == UP_FOR_RESCHEDULE. In the normal scheduler flow the scheduler
advances state to QUEUED before the worker picks up the task, so
ti.refresh_from_db() returns QUEUED and the guard never fires. This causes
start_date to be reset to utcnow() on every re-execution, inflating the
dagrun.first_task_start_delay and dagrun.first_task_scheduling_delay metrics
by the full reschedule wait time.

Replace the state guard with an unconditional TaskReschedule lookup scoped
to the current try_number. The query returns None for non-rescheduled tasks
so behavior is unchanged in the normal case; for rescheduled tasks it
correctly restores start_date from the first poke regardless of whether
state is UP_FOR_RESCHEDULE or QUEUED at execution time.

Report URL: https://github.com/apache/airflow/actions/runs/24055321548

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: jobs-unsubscribe@airflow.apache.org
For additional commands, e-mail: jobs-help@airflow.apache.org