From a6a30a6f9cc9708bdb6059d8589ae0298dc49de2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E4=B8=87=E4=B9=89?= Date: Thu, 20 Aug 2026 18:40:57 +0800 Subject: [PATCH] Fix K8s Alert HTTP test sending failed by using IP address instead of pod name for non-StatefulSet pods (#17883) In Kubernetes mode, NetUtils.getHost() was returning the canonical hostname (pod name) for Deployment-based pods like Alert Server, which is not DNS-resolvable by other pods. This caused the API server to fail connecting to the Alert Server with 'UnknownHostException'. The fix: For non-StatefulSet pods (where canonical hostname doesn't match the ...svc.cluster.local pattern), fall back to the pod's IP address which is always routable within the cluster. Closes #17883 --- .../java/org/apache/dolphinscheduler/common/utils/NetUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/NetUtils.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/NetUtils.java index 12d96e2ad98e..adc1017d6cec 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/NetUtils.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/NetUtils.java @@ -94,7 +94,7 @@ public static String getHost(InetAddress inetAddress) { if (items.length == 6 && "svc".equals(items[3])) { return String.format("%s.%s", items[0], items[1]); } - return canonicalHost; + return inetAddress.getHostAddress(); } if (inetAddress instanceof Inet6Address) { return normalizeV6Address((Inet6Address) inetAddress).getHostAddress();