Skip to content

Fix ipv4 ipv6 dualstack#2408

Merged
simon-mo merged 2 commits intovllm-project:mainfrom
yunfeng-scale:yunfeng-ipv4-ipv6
Jan 10, 2024
Merged

Fix ipv4 ipv6 dualstack#2408
simon-mo merged 2 commits intovllm-project:mainfrom
yunfeng-scale:yunfeng-ipv4-ipv6

Conversation

@yunfeng-scale
Copy link
Copy Markdown
Contributor

@yunfeng-scale yunfeng-scale commented Jan 10, 2024

Fixes #2407
socket.getaddrinfo only returns IPv6 addresses

Copy link
Copy Markdown
Collaborator

@simon-mo simon-mo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the fix makes a lot of sense. i do wonder whether this work across public interface, private interface, and k8s based system

def get_ip() -> str:
return socket.gethostbyname(socket.gethostname())
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("8.8.8.8", 80)) # Doesn't need to be reachable
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happen if it is not reachable? will it timeout/error?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i tried some other non-reachable addresses and this still works

@yunfeng-scale
Copy link
Copy Markdown
Contributor Author

the fix makes a lot of sense. i do wonder whether this work across public interface, private interface, and k8s based system

tested in k8s cluster and it fixes

@simon-mo simon-mo merged commit 4b61c6b into vllm-project:main Jan 10, 2024
hongxiayang pushed a commit to hongxiayang/vllm that referenced this pull request Jan 18, 2024
hongxiayang pushed a commit to hongxiayang/vllm that referenced this pull request Feb 13, 2024
@ZiyueHuang
Copy link
Copy Markdown

@simon-mo @yunfeng-scale I encountered the same issue (OSError: [Errno 101] Network is unreachable) as in #2857, which seems to be introduced by this PR.

I use s.connect(("0.0.0.0", 80)) instead, then it works fine. However, I'm not sure whether this is a proper or universal solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failed to get local ipv4 IP at start

3 participants