Skip to content

[v3-3-test] Fix retry policy overrides not persisted to task instance history (#69235)#69241

Merged
vatsrahul1001 merged 2 commits into
v3-3-testfrom
backport-3bfa5ff-v3-3-test
Jul 3, 2026
Merged

[v3-3-test] Fix retry policy overrides not persisted to task instance history (#69235)#69241
vatsrahul1001 merged 2 commits into
v3-3-testfrom
backport-3bfa5ff-v3-3-test

Conversation

@github-actions

@github-actions github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

AIP-105's per-try audit trail (retry_delay_override, retry_reason) is meant to
live durably in task_instance_history — the columns on the live task_instance
row are transient and cleared when the task next enters RUNNING. The Execution
API retry handler wrote the overrides only into the live-row UPDATE and archived
the task instance to history before those values were applied, so the history
columns were always NULL. That silently dropped the audit trail the feature
advertises, while retry timing (which reads the live row) stayed correct.

Setting the overrides on the task instance before prepare_db_for_next_try() lets
record_ti() snapshot them into task_instance_history, restoring the per-try
record.
(cherry picked from commit 3bfa5ff)

Co-authored-by: Rahul Vats 43964496+vatsrahul1001@users.noreply.github.com

… history (#69235)

AIP-105's per-try audit trail (retry_delay_override, retry_reason) is meant to
live durably in task_instance_history — the columns on the live task_instance
row are transient and cleared when the task next enters RUNNING. The Execution
API retry handler wrote the overrides only into the live-row UPDATE and archived
the task instance to history before those values were applied, so the history
columns were always NULL. That silently dropped the audit trail the feature
advertises, while retry timing (which reads the live row) stayed correct.

Setting the overrides on the task instance before prepare_db_for_next_try() lets
record_ti() snapshot them into task_instance_history, restoring the per-try
record.
(cherry picked from commit 3bfa5ff)

Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com>
@boring-cyborg boring-cyborg Bot added area:API Airflow's REST/HTTP API area:task-sdk labels Jul 2, 2026
@vatsrahul1001 vatsrahul1001 marked this pull request as ready for review July 2, 2026 09:52
@vatsrahul1001 vatsrahul1001 added this to the Airflow 3.3.0 milestone Jul 3, 2026
@vatsrahul1001 vatsrahul1001 added the type:bug-fix Changelog: Bug Fixes label Jul 3, 2026
@vatsrahul1001 vatsrahul1001 merged commit 8e77f9e into v3-3-test Jul 3, 2026
71 checks passed
@vatsrahul1001 vatsrahul1001 deleted the backport-3bfa5ff-v3-3-test branch July 3, 2026 06:38
vatsrahul1001 added a commit that referenced this pull request Jul 3, 2026
… history (#69235) (#69241)

AIP-105's per-try audit trail (retry_delay_override, retry_reason) is meant to
live durably in task_instance_history — the columns on the live task_instance
row are transient and cleared when the task next enters RUNNING. The Execution
API retry handler wrote the overrides only into the live-row UPDATE and archived
the task instance to history before those values were applied, so the history
columns were always NULL. That silently dropped the audit trail the feature
advertises, while retry timing (which reads the live row) stayed correct.

Setting the overrides on the task instance before prepare_db_for_next_try() lets
record_ti() snapshot them into task_instance_history, restoring the per-try
record.
(cherry picked from commit 3bfa5ff)

Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com>
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 type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants