jscheffl commented on code in PR #44547:
URL: https://github.com/apache/airflow/pull/44547#discussion_r1887210593


##########
airflow/models/taskinstance.py:
##########
@@ -1127,7 +1127,8 @@ def _handle_failure(
         )
 
     if not test_mode:
-        TaskInstance.save_to_db(failure_context["ti"], session)
+        task_instance.dag_run.refresh_from_db()

Review Comment:
   I am not sure about this one. Here you refresh the _DagRun_ and not the TI 
from DB.
   
   In the error description/PR Header you write the task instance might be 
updated twice. But usually when you mark a TI as "failed" manually it is 
terminated. Is this error situation ALWAYS happening or only in a race when you 
mark it manually and the TI is close to completion?
   
   And are you talking about on_error callback on the DAG or on the TI? 
Assuming if you mark failed it is on TI level and not the DAG itself?



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