potiuk commented on code in PR #52952:
URL: https://github.com/apache/airflow/pull/52952#discussion_r2188521559
##########
providers/edge3/src/airflow/providers/edge3/plugins/edge_executor_plugin.py:
##########
@@ -213,12 +214,18 @@ def change_maintenance_comment(self, worker_name: str):
except AirflowConfigException:
EDGE_EXECUTOR_ACTIVE = False
+# Load the API endpoint only on api-server (Airflow 3.x) or webserver (Airflow
2.x)
+if AIRFLOW_V_3_0_PLUS:
+ RUNNING_ON_APISERVER = sys.argv[1] in ["api-server"] if len(sys.argv) > 1
else False
+else:
+ RUNNING_ON_APISERVER = "gunicorn" in sys.argv[0] and "airflow-webserver"
in sys.argv
Review Comment:
I honestly think (and this was my thinking for a while) - that we should
move away from initializing plugins manager and other things we initialize in
`__init__.py` of airflow implicitly and replace it with the
"@providers_configurations_loaded" style of annotations - or similar - when it
is needed. Or similar approach. We are doing a lot of lazy initialization of
things to bypass the general problem that we chose for "import airflow" to
initialize everything. The problem is that we are getting into the realm that
"everything" means differnet things depending on what component we run.
I will just state it here as a general comment and would love to get a
proper discussion about it - happy to start one on devlist - if that idea
sparks anyone's positive answer. So far pretty much every time I mentioned it,
it was met with kind of a silence - so I wonder if maybe I am completely wrong
with my assesment.
No idea - maybe I am just wrong, so until I see a single - "yeah, sound like
a good idea". I am not going to raise a big discussion about it.
--
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]