mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-13 15:25:01 +08:00
[Minor fix] The domain dns.google may cause a socket.gaierror exception (#3176)
Co-authored-by: guofangze <guofangze@kuaishou.com>
This commit is contained in:
parent
9cbc7e5f3b
commit
76e8a70476
@ -173,7 +173,7 @@ def get_ip() -> str:
|
|||||||
# try ipv4
|
# try ipv4
|
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||||
try:
|
try:
|
||||||
s.connect(("dns.google", 80)) # Doesn't need to be reachable
|
s.connect(("8.8.8.8", 80)) # Doesn't need to be reachable
|
||||||
return s.getsockname()[0]
|
return s.getsockname()[0]
|
||||||
except OSError:
|
except OSError:
|
||||||
# try ipv6
|
# try ipv6
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user