jason810496 commented on code in PR #69248:
URL: https://github.com/apache/airflow/pull/69248#discussion_r3520093493
##########
airflow-core/src/airflow/models/taskinstancehistory.py:
##########
@@ -211,8 +211,11 @@ def record_ti(ti: TaskInstance, *, session: Session =
NEW_SESSION) -> None:
ti_history_state = ti.state
if ti.state not in State.finished:
ti_history_state = TaskInstanceState.FAILED
- ti.end_date = timezone.utcnow()
- ti.set_duration()
+ # Callers that know when the try actually ended (e.g. the
Execution API
+ # retry path) pre-set end_date; only stamp archive time when unset.
+ if ti.end_date is None:
+ ti.end_date = timezone.utcnow()
+ ti.set_duration()
Review Comment:
Sure, I addressed in
https://github.com/apache/airflow/pull/69248/changes/0c853e47288c143fe963903a3c99786f1c7e5edb.
--
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]