phanikumv commented on code in PR #69248:
URL: https://github.com/apache/airflow/pull/69248#discussion_r3527066996


##########
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.

Review Comment:
   Now that there is a dedicated test for the fallback, the coupling between 
end_date and set_duration() is more likely to matter....



-- 
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]

Reply via email to