uranusjr commented on code in PR #66854:
URL: https://github.com/apache/airflow/pull/66854#discussion_r3457390216


##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -517,14 +526,44 @@ def ti_update_state(
                     task_id=task_id,
                     map_index=map_index,
                 )
+                session.commit()
             except Exception:
+                session.rollback()
                 log.warning(
                     "Failed to clear task state on success",
                     dag_id=dag_id,
                     run_id=run_id,
                     task_id=task_id,
                 )
 
+    # Asset registration runs outside the TI row lock. Failures are logged and 
counted;
+    # raising HTTP 500 here would be misleading because the task already 
succeeded and
+    # would make the worker retry a state update that has already completed. 
Durable
+    # retry/reconciliation for dropped asset events is out of scope for this 
hot-path fix.

Review Comment:
   Things mentioned in this comment is obvious to anyone who can reasonably 
read Python code. Useless.



##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -517,14 +526,44 @@ def ti_update_state(
                     task_id=task_id,
                     map_index=map_index,
                 )
+                session.commit()
             except Exception:
+                session.rollback()
                 log.warning(
                     "Failed to clear task state on success",
                     dag_id=dag_id,
                     run_id=run_id,
                     task_id=task_id,
                 )
 
+    # Asset registration runs outside the TI row lock. Failures are logged and 
counted;
+    # raising HTTP 500 here would be misleading because the task already 
succeeded and
+    # would make the worker retry a state update that has already completed. 
Durable
+    # retry/reconciliation for dropped asset events is out of scope for this 
hot-path fix.

Review Comment:
   Things mentioned in this comment are obvious to anyone who can reasonably 
read Python code. Useless.



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