anishgirianish commented on code in PR #62343:
URL: https://github.com/apache/airflow/pull/62343#discussion_r3029297767
##########
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:
Hi @pierrejeambrun , thank you for flagging this. Just wanted to note that
this follows the same pattern already used in _execute_work (line 148) for task
execution, the localhost:8080 is a fallback when [api] base_url isn't
configured and returns a relative path. I completely understand the concern,
though. Would you have a preferred approach for handling this? Happy to go
whichever direction you suggest. Thank you!
--
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]