Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] Fix some cases of The client socket has timed out after 600s while trying to connect to #10492

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion vllm/envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

if TYPE_CHECKING:
VLLM_HOST_IP: str = ""
HOST_IP: str = ""
VLLM_PORT: Optional[int] = None
VLLM_RPC_BASE_PATH: str = tempfile.gettempdir()
VLLM_USE_MODELSCOPE: bool = False
Expand Down Expand Up @@ -153,7 +154,13 @@ def get_default_config_root():
# If you are using multi-node inference, you should set this differently
# on each node.
'VLLM_HOST_IP':
lambda: os.getenv('VLLM_HOST_IP', "") or os.getenv("HOST_IP", ""),
lambda: os.getenv('VLLM_HOST_IP', ""),

# used in distributed environment to determine the ip address
# of the current node, when the env variable VLLM_HOST_IP is not set
# and the it's hard to get the host ip.
'HOST_IP':
lambda: os.getenv('HOST_IP', ""),

# used in distributed environment to manually set the communication port
# Note: if VLLM_PORT is set, and some code asks for multiple ports, the
Expand Down
20 changes: 14 additions & 6 deletions vllm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,11 @@ def get_ip() -> str:
except Exception:
pass

try:
return socket.gethostbyname(socket.gethostname())
except Exception:
pass

# try ipv6
try:
s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
Expand All @@ -489,12 +494,15 @@ def get_ip() -> str:
except Exception:
pass

warnings.warn(
"Failed to get the IP address, using 0.0.0.0 by default."
"The value can be set by the environment variable"
" VLLM_HOST_IP or HOST_IP.",
stacklevel=2)
return "0.0.0.0"
if envs.HOST_IP:
return envs.HOST_IP
else:
warnings.warn(
"Failed to get the IP address, using 0.0.0.0 by default."
"The value can be set by the environment variable"
" VLLM_HOST_IP or HOST_IP.",
stacklevel=2)
return "0.0.0.0"


def is_valid_ipv6_address(address: str) -> bool:
Expand Down