-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Ensure Edge Plugin for API endpoint is only loaded on API-Server and AF2 Webserver #52952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure Edge Plugin for API endpoint is only loaded on API-Server and AF2 Webserver #52952
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ensures the Edge plugin’s API endpoint only loads on the intended Airflow components (API server in Airflow 3.x or webserver in Airflow 2.x) by detecting the runtime context and gating the endpoint registration.
- Imports
sysand addsRUNNING_ON_APISERVERflag based onsys.argv - Guards the plugin’s API endpoint registration with
RUNNING_ON_APISERVER - Maintains existing behavior for older Airflow releases
Comments suppressed due to low confidence (1)
providers/edge3/src/airflow/providers/edge3/plugins/edge_executor_plugin.py:218
- There are no tests covering the new
RUNNING_ON_APISERVERlogic. Adding unit tests to simulate differentsys.argvvalues would ensure the endpoint only loads under the correct conditions.
if AIRFLOW_V_3_0_PLUS:
providers/edge3/src/airflow/providers/edge3/plugins/edge_executor_plugin.py
Show resolved
Hide resolved
providers/edge3/src/airflow/providers/edge3/plugins/edge_executor_plugin.py
Show resolved
Hide resolved
providers/edge3/src/airflow/providers/edge3/plugins/edge_executor_plugin.py
Show resolved
Hide resolved
8991756 to
787465e
Compare
amoghrajesh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, fine for now!
787465e to
67791b7
Compare
…AF2 Webserver (apache#52952) * Ensure Edge Plugin for API endpoint is only loaded on API-Server and AF2 Webserver * Fix and extend pytests for edge3 plugin * Add a note to clean bad init code up
closes: #52922
I have noticed during providers release testing July 2025 that API endpoint is started also on TaskSDK task runner and other components. But the API plugin endpoint should only be loaded and be active on API server on Airflow 3 and Webserver is running on Airflow 2.
Unfortuantely in plugins_manager there is currently no concept in detecting this, while this needs to be created a secondary check is added to check on which component the plugin is loaded.
Negative side effect: If you run
AIRFLOW__CORE__EXECUTOR=airflow.providers.edge3.executors.edge_executor.EdgeExecutor airflow plugins -o yamlthen the plugin is listed but is not providing the details of the endpoint. This is only provided on API server and webserver now.