uranusjr commented on code in PR #66854:
URL: https://github.com/apache/airflow/pull/66854#discussion_r3457382720
##########
airflow-core/src/airflow/assets/manager.py:
##########
@@ -356,8 +357,17 @@ def register_asset_change(
).unique()
for asset_alias_model in asset_alias_models:
- asset_alias_model.asset_events.append(asset_event)
- session.add(asset_alias_model)
+ # Use a direct INSERT rather than ORM .append() to avoid
lazy-loading the
+ # entire asset_events collection. On long-running deployments
that collection
+ # can contain thousands of rows; loading it on the
task-success hot path can
+ # leave DB connections idle-in-transaction for minutes,
blocking other workers.
+ # This intentionally leaves asset_alias_model.asset_events
unsynced in-session.
Review Comment:
This is too much text. Arguably only the first one and a half sentences are
needed. The last sentence is also unsatisfying; why is it intentional? Does it
not cause other issues? Why are those other issues not relevant here?
--
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]