You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by "zhang-arvin (via GitHub)" <gi...@apache.org> on 2026/08/20 10:42:31 UTC
[PR] [Fix-17883] Fix K8s Alert HTTP test sending failed by using IP for non-StatefulSet pods [dolphinscheduler]
zhang-arvin opened a new pull request, #18574:
URL: https://github.com/apache/dolphinscheduler/pull/18574
## Purpose
Fix the issue where Alert HTTP test sending fails in Kubernetes environment.
**Issue**: #17883
## Root Cause
When running in Kubernetes mode, `NetUtils.getHost()` returns the canonical hostname (pod name) for Deployment-based pods like Alert Server. For example, `dolphinscheduler-alert-67b7c695cb-v9b82`. This pod name is not DNS-resolvable by other pods, causing the API server to fail connecting to the Alert Server with `UnknownHostException`.
The existing code handles StatefulSet pods correctly (pattern: `<pod>.<service>.<ns>.svc.cluster.local`), extracting `pod.service` which is resolvable. But for Deployment pods, the canonical hostname is just the pod name.
## Fix
In `NetUtils.getHost(InetAddress)`, when in Kubernetes mode and the canonical hostname does NOT match the StatefulSet pattern (6 parts with "svc" at index 3), fall back to the pod's IP address using `inetAddress.getHostAddress()`. The IP address is always routable within the Kubernetes cluster.
## Changes
- `dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/NetUtils.java`: Changed line 97 from `return canonicalHost;` to `return inetAddress.getHostAddress();`
This is a one-line fix that preserves the existing behavior for StatefulSet pods (Master/Worker) while fixing the issue for Deployment pods (Alert Server).
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-17883] Fix K8s Alert HTTP test sending failed by using IP for non-StatefulSet pods [dolphinscheduler]
Posted by "zhang-arvin (via GitHub)" <gi...@apache.org>.
zhang-arvin commented on PR #18574:
URL: https://github.com/apache/dolphinscheduler/pull/18574#issuecomment-5520357830
@SbloodyS Thanks for catching this! I have added IPv6 normalization in the Kubernetes fallback path:
```java
if (inetAddress instanceof Inet6Address) {
return normalizeV6Address((Inet6Address) inetAddress).getHostAddress();
}
return inetAddress.getHostAddress();
```
This ensures that scoped IPv6 addresses (e.g., `fd00::1234%eth0`) are properly normalized before being returned in K8s mode. Also added a K8s-mode IPv6 test with scope identifier in `NetUtilsTest.testGetHostInKubernetesMode`. Please take another look.
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-17883] Fix K8s Alert HTTP test sending failed by using IP for non-StatefulSet pods [dolphinscheduler]
Posted by "zhang-arvin (via GitHub)" <gi...@apache.org>.
zhang-arvin commented on PR #18574:
URL: https://github.com/apache/dolphinscheduler/pull/18574#issuecomment-5372946719
Thanks @SbloodyS, I've updated the PR description to follow the template.
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-17883] Fix K8s Alert HTTP test sending failed by using IP for non-StatefulSet pods [dolphinscheduler]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #18574:
URL: https://github.com/apache/dolphinscheduler/pull/18574#issuecomment-5473364369
Awesome work, congrats on your first merged pull request!
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-17883] Fix K8s Alert HTTP test sending failed by using IP for non-StatefulSet pods [dolphinscheduler]
Posted by "zhang-arvin (via GitHub)" <gi...@apache.org>.
zhang-arvin commented on PR #18574:
URL: https://github.com/apache/dolphinscheduler/pull/18574#issuecomment-5364818613
Thanks for the review @SbloodyS! I have updated the PR description to follow the pull request template, adding the required sections: "Was this PR generated or assisted by AI?", "Brief change log", and "Verify this pull request".
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-17883] Fix K8s Alert HTTP test sending failed by using IP for non-StatefulSet pods [dolphinscheduler]
Posted by "zhang-arvin (via GitHub)" <gi...@apache.org>.
zhang-arvin commented on PR #18574:
URL: https://github.com/apache/dolphinscheduler/pull/18574#issuecomment-5433103299
@SbloodyS Thanks for the review! I have:
1. Updated the PR description to follow the template
2. Updated `NetUtilsTest.testGetHostInKubernetesMode` — the last two test cases now stub `getHostAddress()` and assert the returned IP address. The last case also serves as an explicit regression test for Kubernetes Deployment pods where the hostname is short (no svc suffix).
Please take another look when you have a chance.
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-17883] Fix K8s Alert HTTP test sending failed by using IP for non-StatefulSet pods [dolphinscheduler]
Posted by "zhang-arvin (via GitHub)" <gi...@apache.org>.
zhang-arvin commented on PR #18574:
URL: https://github.com/apache/dolphinscheduler/pull/18574#issuecomment-5469082833
@SbloodyS Thanks for catching this! I have added IPv6 normalization in the Kubernetes fallback path:
```java
if (inetAddress instanceof Inet6Address) {
return normalizeV6Address((Inet6Address) inetAddress).getHostAddress();
}
return inetAddress.getHostAddress();
```
This ensures that scoped IPv6 addresses (e.g., `fd00::1234%eth0`) are properly normalized before being returned in K8s mode, consistent with the non-K8s path below.
Please take another look when you have a chance.
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-17883] Fix K8s Alert HTTP test sending failed by using IP for non-StatefulSet pods [dolphinscheduler]
Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS merged PR #18574:
URL: https://github.com/apache/dolphinscheduler/pull/18574
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-17883] Fix K8s Alert HTTP test sending failed by using IP for non-StatefulSet pods [dolphinscheduler]
Posted by "zhang-arvin (via GitHub)" <gi...@apache.org>.
zhang-arvin commented on PR #18574:
URL: https://github.com/apache/dolphinscheduler/pull/18574#issuecomment-5372739871
Thanks @SbloodyS, I'll update the PR description to follow the template.
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org