Skip to content

Commit e985432

Browse files
authored
[bugfix] fix proxy hen host ip using domain name (#4243)
### What this PR does / why we need it? fix proxy when host ip using domain name - vLLM version: v0.11.0 - vLLM main: vllm-project/vllm@2918c1b --------- Signed-off-by: liziyu <[email protected]>
1 parent a30261f commit e985432

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

examples/disaggregated_prefill_v1/load_balance_proxy_layerwise_server_example.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ class ServerState:
116116
def __init__(self, host, port):
117117
self.host = host
118118
self.port = port
119-
ip = ipaddress.ip_address(self.host)
120-
if isinstance(ip, ipaddress.IPv4Address):
121-
self.url = f'http://{host}:{port}/v1'
122-
elif isinstance(ip, ipaddress.IPv6Address):
123-
self.url = f'http://[{host}]:{port}/v1'
124-
else:
125-
raise RuntimeError(f"Invild host IP address {ip}")
119+
self.url = f'http://{host}:{port}/v1'
120+
try:
121+
ip = ipaddress.ip_address(self.host)
122+
if isinstance(ip, ipaddress.IPv6Address):
123+
self.url = f'http://[{host}]:{port}/v1'
124+
except Exception:
125+
pass
126126
self.client = httpx.AsyncClient(timeout=None,
127127
base_url=self.url,
128128
limits=httpx.Limits(

examples/disaggregated_prefill_v1/load_balance_proxy_server_example.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ class ServerState:
118118
def __init__(self, host, port):
119119
self.host = host
120120
self.port = port
121-
ip = ipaddress.ip_address(self.host)
122-
if isinstance(ip, ipaddress.IPv4Address):
123-
self.url = f'http://{host}:{port}/v1'
124-
elif isinstance(ip, ipaddress.IPv6Address):
125-
self.url = f'http://[{host}]:{port}/v1'
126-
else:
127-
raise RuntimeError(f"Invild host IP address {ip}")
121+
self.url = f'http://{host}:{port}/v1'
122+
try:
123+
ip = ipaddress.ip_address(self.host)
124+
if isinstance(ip, ipaddress.IPv6Address):
125+
self.url = f'http://[{host}]:{port}/v1'
126+
except Exception:
127+
pass
128128
self.client = httpx.AsyncClient(timeout=None,
129129
base_url=self.url,
130130
limits=httpx.Limits(

vllm_ascend/distributed/mooncake/transfer_engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def get_global_te(hostname: str, device_name: Optional[str]):
1313
ip = ipaddress.ip_address(hostname)
1414
if isinstance(ip, ipaddress.IPv6Address):
1515
raise RuntimeError(
16-
"The backend if mooncake's Ascend Direct Xfer Library currcenly dose not support IPv6."
16+
"The backend of mooncake's Ascend Direct Xfer Library currently does not support IPv6."
1717
)
1818
except ValueError:
1919
pass

0 commit comments

Comments
 (0)