ferruzzi commented on code in PR #62343:
URL: https://github.com/apache/airflow/pull/62343#discussion_r3041344867
##########
airflow-core/src/airflow/executors/local_executor.py:
##########
@@ -169,6 +178,81 @@ def _execute_callback(log: Logger, workload:
workloads.ExecuteCallback, team_con
raise RuntimeError(error_msg or "Callback execution failed")
+def _execute_connection_test(log: Logger, workload: workloads.TestConnection,
team_conf) -> None:
+ """
+ Execute a connection test workload.
+
+ Constructs an SDK ``Client``, fetches the connection via the Execution API,
+ enforces a timeout via ``signal.alarm``, and reports all outcomes back
+ through the Execution API.
+
+ :param log: Logger instance
+ :param workload: The TestConnection workload to execute
+ :param team_conf: Team-specific executor configuration
+ """
+ # Lazy import: SDK modules must not be loaded at module level to avoid
+ # coupling core (scheduler-loaded) code to the SDK.
+ from airflow.sdk.api.client import Client
+
+ setproctitle(
+ f"{_get_executor_process_title_prefix(team_conf.team_name)}
connection-test {workload.connection_id}",
+ log,
+ )
+
+ base_url = team_conf.get("api", "base_url", fallback="/")
+ if base_url.startswith("/"):
+ base_url = f"http://localhost:8080{base_url}"
Review Comment:
Yeah, for better or worse, that's existing code
[here](https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/executors/local_executor.py#L136-L140)
which I am moving into a new helper named
`local_executor::_get_execution_api_server_url()` in
https://github.com/apache/airflow/pull/62645
([here](https://github.com/apache/airflow/pull/62645/changes#diff-e6c8f3d778a4f3366b23d8d46a1c9650608ccbf2184e7292f0f7bbf4df37dbebR53-R64))
--
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]