seanghaeli commented on code in PR #66608:
URL: https://github.com/apache/airflow/pull/66608#discussion_r3350692818


##########
airflow-core/src/airflow/triggers/callback.py:
##########
@@ -32,6 +32,46 @@
 PAYLOAD_BODY_KEY = "body"
 
 
+def _ensure_bundle_module_registered(callback_path: str) -> None:
+    """
+    Register an unusual_prefix_{hash}_{stem} module so import_string can find 
it.
+
+    The triggerer event loop doesn't run the DAG processor, so DAG files with 
mangled
+    module names must be registered manually. Walks all configured bundles to 
find the
+    file, then delegates the actual loading to _load_mangled_module in 
callback_supervisor.
+    """
+    import sys
+    from pathlib import Path
+
+    mod_name = callback_path.split(".")[0]

Review Comment:
   Added hash verification so it only loads when the path matches, and moved 
the whole thing off the event loop with asyncio.to_thread



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