Add async connection testing via workers for security isolation#62343
Open
anishgirianish wants to merge 38 commits intoapache:mainfrom
Open
Add async connection testing via workers for security isolation#62343anishgirianish wants to merge 38 commits intoapache:mainfrom
anishgirianish wants to merge 38 commits intoapache:mainfrom
Conversation
39ba192 to
3efcd26
Compare
jason810496
reviewed
Feb 23, 2026
airflow-core/src/airflow/api_fastapi/core_api/routes/public/connections.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/routes/public/connections.py
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/execution_api/routes/connection_tests.py
Show resolved
Hide resolved
Contributor
Author
|
@jason810496 Thanks for the thorough review! Addressed your feedback in the latest push:
Could you please take another look when you get a chance? Thanks! |
33392ec to
59d2c88
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Was generative AI tooling used to co-author this PR?
Summary
Follows the direction proposed by @potiuk in #59643 to move connection testing off the API server and onto workers.
Connection testing has been disabled by default since Airflow 2.7.0 because executing user-supplied driver code (ODBC/JDBC) on the API server poses security risks, and workers typically have network access to external systems that API servers don't.
This moves the whole thing onto workers. A dedicated
TestConnectionworkload goes through the scheduler, gets dispatched to a supporting executor, and the worker runs test_connection()` with a proper timeout. Results come back through the Execution API. Design was discussed on dev@ : "[DISCUSS] Move connection testing to workers" (Feb 2026).Demo
breeze-e2e-rundown-compressed.mp4
Overview
ExecuteCallback, so connection tests never compete with correctness-critical callbacksmax_connection_test_concurrency(default 4). A reaper catches stuck tests after timeout + grace periodsignal.alarmenforcement in LocalExecutor, results reported back via Execution APIconnection_idthrough secrets backend), with before/after snapshots. Test failure triggersattempt_revert()with concurrent-edit detection so third-party changes aren't overwrittenqueuefield on the API, wired through to scheduler dispatch.supports_connection_testflag on BaseExecutor, immediate FAILED if no executor supports itConfig
[core] connection_test_timeout: worker timeout, default 60s[core] max_connection_test_concurrency: dispatch budget, default 4[scheduler] connection_test_reaper_interval: reaper frequency, default 30sNot in this PR
References
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.