jason810496 commented on code in PR #50371:
URL: https://github.com/apache/airflow/pull/50371#discussion_r2150048695
##########
airflow-core/src/airflow/dag_processing/processor.py:
##########
@@ -253,6 +281,15 @@ def start( # type: ignore[override]
client: Client,
**kwargs,
) -> Self:
+ # Pre-import Airflow modules in parent process to save CPU time and
memory
+ # This prevents them from being re-imported from zero in each
processing subprocess
+ import structlog
+
+ log = structlog.get_logger(logger_name="dag_processor")
Review Comment:
My mistake, before move to the line before `proc: Self = super().start()` we
can get `log` from the argument of the function. After moving there, IMO, it's
fine to use `structlog.get_logger` to retrieve the logger, and will resolve
most of the test errors.
--
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]