From e98543267a672989da4eccf49420d6e432a46624 Mon Sep 17 00:00:00 2001 From: liziyu <56102866+liziyu179@users.noreply.github.com> Date: Tue, 18 Nov 2025 16:30:51 +0800 Subject: [PATCH] [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: https://github.com/vllm-project/vllm/commit/2918c1b49c88c29783c86f78d2c4221cb9622379 --------- Signed-off-by: liziyu --- .../load_balance_proxy_layerwise_server_example.py | 14 +++++++------- .../load_balance_proxy_server_example.py | 14 +++++++------- .../distributed/mooncake/transfer_engine.py | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/disaggregated_prefill_v1/load_balance_proxy_layerwise_server_example.py b/examples/disaggregated_prefill_v1/load_balance_proxy_layerwise_server_example.py index 1bf0859b..53353cea 100644 --- a/examples/disaggregated_prefill_v1/load_balance_proxy_layerwise_server_example.py +++ b/examples/disaggregated_prefill_v1/load_balance_proxy_layerwise_server_example.py @@ -116,13 +116,13 @@ class ServerState: def __init__(self, host, port): self.host = host self.port = port - ip = ipaddress.ip_address(self.host) - if isinstance(ip, ipaddress.IPv4Address): - self.url = f'http://{host}:{port}/v1' - elif isinstance(ip, ipaddress.IPv6Address): - self.url = f'http://[{host}]:{port}/v1' - else: - raise RuntimeError(f"Invild host IP address {ip}") + self.url = f'http://{host}:{port}/v1' + try: + ip = ipaddress.ip_address(self.host) + if isinstance(ip, ipaddress.IPv6Address): + self.url = f'http://[{host}]:{port}/v1' + except Exception: + pass self.client = httpx.AsyncClient(timeout=None, base_url=self.url, limits=httpx.Limits( diff --git a/examples/disaggregated_prefill_v1/load_balance_proxy_server_example.py b/examples/disaggregated_prefill_v1/load_balance_proxy_server_example.py index 0848ae02..c02a6fa1 100644 --- a/examples/disaggregated_prefill_v1/load_balance_proxy_server_example.py +++ b/examples/disaggregated_prefill_v1/load_balance_proxy_server_example.py @@ -118,13 +118,13 @@ class ServerState: def __init__(self, host, port): self.host = host self.port = port - ip = ipaddress.ip_address(self.host) - if isinstance(ip, ipaddress.IPv4Address): - self.url = f'http://{host}:{port}/v1' - elif isinstance(ip, ipaddress.IPv6Address): - self.url = f'http://[{host}]:{port}/v1' - else: - raise RuntimeError(f"Invild host IP address {ip}") + self.url = f'http://{host}:{port}/v1' + try: + ip = ipaddress.ip_address(self.host) + if isinstance(ip, ipaddress.IPv6Address): + self.url = f'http://[{host}]:{port}/v1' + except Exception: + pass self.client = httpx.AsyncClient(timeout=None, base_url=self.url, limits=httpx.Limits( diff --git a/vllm_ascend/distributed/mooncake/transfer_engine.py b/vllm_ascend/distributed/mooncake/transfer_engine.py index 69900308..d4e172b7 100644 --- a/vllm_ascend/distributed/mooncake/transfer_engine.py +++ b/vllm_ascend/distributed/mooncake/transfer_engine.py @@ -13,7 +13,7 @@ def get_global_te(hostname: str, device_name: Optional[str]): ip = ipaddress.ip_address(hostname) if isinstance(ip, ipaddress.IPv6Address): raise RuntimeError( - "The backend if mooncake's Ascend Direct Xfer Library currcenly dose not support IPv6." + "The backend of mooncake's Ascend Direct Xfer Library currently does not support IPv6." ) except ValueError: pass