You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2025/06/03 10:05:39 UTC
(airflow) 08/08: Fix execution API server URL handling for relative paths in KE (#51183)
This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v3-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 24a0b3f1bed065da84e42d97625e89e5c110846a
Author: Kaxil Naik <ka...@apache.org>
AuthorDate: Thu May 29 05:59:10 2025 +0530
Fix execution API server URL handling for relative paths in KE (#51183)
(cherry picked from commit 420f4cf0bc772a6e42c7286e5dc3e01e56911c93)
---
task-sdk/src/airflow/sdk/execution_time/execute_workload.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/task-sdk/src/airflow/sdk/execution_time/execute_workload.py b/task-sdk/src/airflow/sdk/execution_time/execute_workload.py
index 220cd65c5ec..b06a0d22cb4 100644
--- a/task-sdk/src/airflow/sdk/execution_time/execute_workload.py
+++ b/task-sdk/src/airflow/sdk/execution_time/execute_workload.py
@@ -56,6 +56,9 @@ def execute_workload(workload: ExecuteTask) -> None:
log.info("Executing workload", workload=workload)
base_url = conf.get("api", "base_url", fallback="/")
+ # If it's a relative URL, use localhost:8080 as the default
+ if base_url.startswith("/"):
+ base_url = f"http://localhost:8080{base_url}"
default_execution_api_server = f"{base_url.rstrip('/')}/execution/"
server = conf.get("core", "execution_api_server_url", fallback=default_execution_api_server)
log.info("Connecting to server:", server=server)