Repository navigation
[Fix] rust-server: Derive advertised host towards dist_init_addr and reject loopback on multi-node - #47534
Open
devtyagi3909 wants to merge 1 commit into
Open
[Fix] rust-server: Derive advertised host towards dist_init_addr and reject loopback on multi-node#47534devtyagi3909 wants to merge 1 commit into
devtyagi3909 wants to merge 1 commit into
Conversation
4 of 5 tasks
…eject loopback on multi-node
devtyagi3909
force-pushed
the
fix-rust-server-advertised-host
branch
from
November 7, 2026 12:23
417f0b1 to
741d74d
Compare
This branch has not been deployed
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.
closes #47509
why
in multi-node deployments with rust server (
SGLANG_RUST_SERVER=1),gather_server_endpoints()resolved wildcard listener binds (0.0.0.0,::) viaget_local_ip_auto(fallback="127.0.0.1"). on multi-homed or isolated cluster nodes without default routes, this can either pick an unroutable interface or fall back to loopback (127.0.0.1). when it fell back to loopback, it only logged a warning and published127.0.0.1:<port>anyway. other ranks then relayed control requests (/flush_cache,/start_profile, etc.) to127.0.0.1, which routed to their own local listener at the same offset rather than the target rank.also,
_rendezvous_is_loopbackfailed to recognize schemes indist_init_addrliketcp://127.0.0.1:5000becauseNetworkAddress.parsedid not strip scheme prefixes.what changed
get_local_ip_towards()innetwork.pythat probes a connected udp socket towards target host/port (getsockname, no network traffic sent).gather_server_endpoints(), when wildcard host is bound:SGLANG_HOST_IP/HOST_IPif set.dist_init_addrwhen set.get_local_ip_auto(fallback="127.0.0.1").nnodes > 1) withValueErrorwhen rendezvous is not loopback, preventing silent misrouting across nodes.NetworkAddress.parse()to strip scheme prefixes (tcp://,http://), enabling_rendezvous_is_loopbackto correctly parsedist_init_addr.test
PYTHONPATH=python python3 -m unittest discover -s test/registered/utils -p "test_network_address.py"(55 passed)PYTHONPATH=test:python python3 -m unittest registered.unit.multimodal.rust.shared.test_rust_server_extension.TestRustServerExtension(all passed)ruff check --select=F401,F821,F823,UP037cleanisort --check-onlycleanCI States
Latest PR Test (Base): ❌ Run #42372272873
Latest PR Test (Extra): ❌ Run #42372272720
Latest PR Test (AMD ROCm 10): ❌ Run #42372272737
Tip
Base CI only covers the core cases, and its workload may not exercise your change. Use
/rerun-testto run the tests your change touches, or copy this prompt for an agent: