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


##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -491,6 +492,14 @@ def ti_update_state(
                 extra=json.dumps({"host_name": hostname}) if hostname else 
None,
             )
         )
+        # Commit the TI state update now to release the task_instance row lock 
before
+        # running asset-event queries. The direct-INSERT fix in AssetManager 
removes
+        # the O(n) lazy-load on the alias-event table, but 
register_asset_changes_in_db
+        # also queries scheduled dags and inserts AssetDagRunQueue rows - all 
of which
+        # would otherwise hold the row lock and cause idle-in-transaction 
pile-up that
+        # exhausts API server memory and triggers OOMKill under high 
concurrency.
+        # The task outcome is durable from this point on.

Review Comment:
   Same, much too long.
   
   As a general rule, you should review all comments generated by an AI agent. 
Please do due diligence in the future and not shift the responsibility to 
reviewers.



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