Unverified Commit f90945c4 authored by storyicon's avatar storyicon Committed by GitHub
Browse files

fix(PD-disaggregation): Can not get local ip (#6792)


Signed-off-by: default avatarstoryicon <storyicon@foxmail.com>
parent 094fbdac
......@@ -2077,6 +2077,14 @@ def get_local_ip_by_remote() -> str:
except Exception:
pass
try:
hostname = socket.gethostname()
ip = socket.gethostbyname(hostname)
if ip and ip != "127.0.0.1" and ip != "0.0.0.0":
return ip
except Exception:
pass
# try ipv6
try:
s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment