Skip to content

Conversation

@jscheffl
Copy link
Contributor

@jscheffl jscheffl commented Jul 6, 2025

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 yaml then the plugin is listed but is not providing the details of the endpoint. This is only provided on API server and webserver now.

@jscheffl jscheffl requested review from Copilot, eladkal and potiuk July 6, 2025 17:39
@jscheffl jscheffl added the type:bug-fix Changelog: Bug Fixes label Jul 6, 2025
@boring-cyborg boring-cyborg bot added area:providers provider:edge Edge Executor / Worker (AIP-69) / edge3 labels Jul 6, 2025
Copy link
Contributor

Copilot AI left a 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 sys and adds RUNNING_ON_APISERVER flag based on sys.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_APISERVER logic. Adding unit tests to simulate different sys.argv values would ensure the endpoint only loads under the correct conditions.
if AIRFLOW_V_3_0_PLUS:

@jscheffl jscheffl force-pushed the bugfix/ensure-edge-plugin-is-only-loaded-on-apiserver branch from 8991756 to 787465e Compare July 13, 2025 14:33
@jscheffl jscheffl requested a review from amoghrajesh July 17, 2025 20:45
Copy link
Contributor

@amoghrajesh amoghrajesh left a 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!

@jscheffl jscheffl force-pushed the bugfix/ensure-edge-plugin-is-only-loaded-on-apiserver branch from 787465e to 67791b7 Compare July 18, 2025 18:46
@jscheffl jscheffl merged commit 4eb776a into apache:main Jul 18, 2025
71 checks passed
karenbraganz pushed a commit to karenbraganz/airflow that referenced this pull request Jul 18, 2025
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:edge Edge Executor / Worker (AIP-69) / edge3 type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Task Runner loads Plugins and fails in DB Connections

3 participants