fix: prefer IPv4 non-link-local in _get_host_ip for Docker (#743)#778
Open
lonexreb wants to merge 1 commit into
Open
fix: prefer IPv4 non-link-local in _get_host_ip for Docker (#743)#778lonexreb wants to merge 1 commit into
lonexreb wants to merge 1 commit into
Conversation
…rch#743) In containers, hostname resolution often returns an IPv6 link-local address (fe80::...) which c10d / TCPStore cannot use, producing: [c10d] The IPv4 network addresses of (fe80::..., 51391) cannot be retrieved (gai error: -9 - Address family for hostname not supported). Replace the unguarded get_ipaddr(hostname, 0) call with an explicit getaddrinfo scan that prefers IPv4 non-link-local, then IPv6 non-link- local, falling back to get_ipaddr only when nothing usable surfaces or resolution fails outright. VLLM_HOST_IP override is preserved. Test plan: tests/unit_tests/test_get_host_ip.py - VLLM_HOST_IP override honored - IPv4 wins over IPv6 link-local (regression for meta-pytorch#743) - IPv4 link-local (169.254/16) skipped - IPv6 link-local skipped, global IPv6 preferred when IPv4 absent - Falls back to Monarch resolver when only link-local addrs exist - Falls back to Monarch resolver on gaierror
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #743.
In containers,
socket.gethostname()+ DNS resolution often surfaces an IPv6 link-local address (fe80::...) first.c10d/TCPStorecannot use those, producing:Replace the unguarded
get_ipaddr(hostname, 0)call with an explicitgetaddrinfoscan that:fe80::/10)169.254.0.0/16)get_ipaddronly when nothing usable surfaces or resolution itself failsVLLM_HOST_IPoverride is preserved.src/forge/actors/vllm/v1/monarch_executor.py(+27/-3)tests/unit_tests/test_get_host_ip.py(6 cases)Test plan
VLLM_HOST_IPenv override still honored169.254/16) skippedget_ipaddrwhen every candidate is link-localget_ipaddrongaierrorpython -m apps.grpo.main --config apps/grpo/qwen3_1_7b.yamlno longer needsVLLM_HOST_IP=127.0.0.1workaround inside Docker (cannot run locally — please verify in container CI)Notes
The reporter (@insop) offered to open a PR; happy to defer to theirs if they prefer. The behavior matches what they proposed in the issue.