Skip to content

[v3-3-test] Archive worker-reported end date and rendered map index on task retry (#69248)#69458

Merged
henry3260 merged 1 commit into
v3-3-testfrom
backport-66b803d-v3-3-test
Jul 6, 2026
Merged

[v3-3-test] Archive worker-reported end date and rendered map index on task retry (#69248)#69458
henry3260 merged 1 commit into
v3-3-testfrom
backport-66b803d-v3-3-test

Conversation

@github-actions

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

Copy link
Copy Markdown
Contributor
  • Archive worker-reported end date and rendered map index on task retry

Follow-up to #69235. The task_instance_history row for a retried try
stamped archive-time utcnow() as end_date instead of the end date the
worker reported, and missed the final rendered map index when the
mid-run update was suppressed (e.g. template errors during failure
handling). Snapshot both onto the TI before archiving, and let
record_ti() respect a pre-set end_date so the audit trail reflects
when the try actually ended.

  • Add test for record_ti fallback end_date stamping

Cover the conditional branch where record_ti() archives a non-finished
TI with end_date=None, verifying it gets stamped with utcnow() and
duration is computed correctly.

  • Clarify record_ti comment covers pre-set duration too

  • Snapshot rendered_map_index in TIH when a retry explicitly clears it
    (cherry picked from commit 66b803d)

Co-authored-by: Jason(Zhe-You) Liu 68415893+jason810496@users.noreply.github.com

…n task retry (#69248)

* Archive worker-reported end date and rendered map index on task retry

Follow-up to #69235. The task_instance_history row for a retried try
stamped archive-time utcnow() as end_date instead of the end date the
worker reported, and missed the final rendered map index when the
mid-run update was suppressed (e.g. template errors during failure
handling). Snapshot both onto the TI before archiving, and let
record_ti() respect a pre-set end_date so the audit trail reflects
when the try actually ended.

* Add test for record_ti fallback end_date stamping

Cover the conditional branch where record_ti() archives a non-finished
TI with end_date=None, verifying it gets stamped with utcnow() and
duration is computed correctly.

* Clarify record_ti comment covers pre-set duration too

* Snapshot rendered_map_index in TIH when a retry explicitly clears it
(cherry picked from commit 66b803d)

Co-authored-by: Jason(Zhe-You) Liu <68415893+jason810496@users.noreply.github.com>
@boring-cyborg boring-cyborg Bot added area:API Airflow's REST/HTTP API area:task-sdk labels Jul 6, 2026
@jason810496 jason810496 marked this pull request as ready for review July 6, 2026 12:33
@henry3260 henry3260 merged commit 06314a0 into v3-3-test Jul 6, 2026
101 of 110 checks passed
@henry3260 henry3260 deleted the backport-66b803d-v3-3-test branch July 6, 2026 15:51
@github-actions github-actions Bot added this to the Airflow 3.3.1 milestone Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Hi maintainer, this PR was merged without a milestone set.
We've automatically set the milestone to Airflow 3.3.1 based on: merged to version branch
If this milestone is not correct, please update it to the appropriate milestone.

This comment was generated by Milestone Tag Assistant.

vatsrahul1001 pushed a commit that referenced this pull request Jul 7, 2026
…n task retry (#69248) (#69458)

* Archive worker-reported end date and rendered map index on task retry

Follow-up to #69235. The task_instance_history row for a retried try
stamped archive-time utcnow() as end_date instead of the end date the
worker reported, and missed the final rendered map index when the
mid-run update was suppressed (e.g. template errors during failure
handling). Snapshot both onto the TI before archiving, and let
record_ti() respect a pre-set end_date so the audit trail reflects
when the try actually ended.

* Add test for record_ti fallback end_date stamping

Cover the conditional branch where record_ti() archives a non-finished
TI with end_date=None, verifying it gets stamped with utcnow() and
duration is computed correctly.

* Clarify record_ti comment covers pre-set duration too

* Snapshot rendered_map_index in TIH when a retry explicitly clears it
(cherry picked from commit 66b803d)

Co-authored-by: Jason(Zhe-You) Liu <68415893+jason810496@users.noreply.github.com>
vatsrahul1001 pushed a commit that referenced this pull request Jul 9, 2026
…n task retry (#69248) (#69458)

* Archive worker-reported end date and rendered map index on task retry

Follow-up to #69235. The task_instance_history row for a retried try
stamped archive-time utcnow() as end_date instead of the end date the
worker reported, and missed the final rendered map index when the
mid-run update was suppressed (e.g. template errors during failure
handling). Snapshot both onto the TI before archiving, and let
record_ti() respect a pre-set end_date so the audit trail reflects
when the try actually ended.

* Add test for record_ti fallback end_date stamping

Cover the conditional branch where record_ti() archives a non-finished
TI with end_date=None, verifying it gets stamped with utcnow() and
duration is computed correctly.

* Clarify record_ti comment covers pre-set duration too

* Snapshot rendered_map_index in TIH when a retry explicitly clears it
(cherry picked from commit 66b803d)

Co-authored-by: Jason(Zhe-You) Liu <68415893+jason810496@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants