Repository navigation
fix(worker): match a process by its advertised address - #13422
Merged
mudler merged 1 commit intoNov 23, 2026
Merged
Conversation
The worker records each backend process under its listen address (127.0.0.1:<port>), but its backend.install reply gives the frontend the advertised address (the worker's advertised host with the same port), and the frontend stores that and sends it back. model.unload and the model.stop address check compared the two literally, so whenever the advertised host is not the loopback address -- a worker on another machine -- model.unload logged "target has no process in this worker" and freed nothing, and model.stop reported an address mismatch. Derive the advertised address in one helper, used by the install reply and by a matcher that accepts either form for the same process. A different host with the same port still does not match. model.unload now dials the matched process's own address for Free(). Assisted-by: Claude:claude-opus-5-5 [golangci-lint] Signed-off-by: Zachary Miller <20159826+CodeByZach@users.noreply.github.com>
2 tasks done
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.
Description
In distributed mode,
model.unloadfrees nothing on a worker that runs on another machine than the frontend. The worker records each backend process under its listen address (127.0.0.1:<port>), but itsbackend.installreply gives the frontend the advertised address (the worker's advertised host with the same port). The frontend stores that and sends it back inmodel.unload, and the worker compared the two literally:while the process was running at
127.0.0.1:50051. Themodel.stopaddress check (stopModelExact) compared the same way.This PR derives the advertised address in one helper,
advertisedBackendAddr, used by the install reply and by a matcher that accepts either form for the same process. A different host with the same port still does not match.model.unloadnow dials the matched process's own address forFree().Notes for Reviewers
model.unloadis what router eviction and reconciler scale-down send, so on such workers they removed the registry row but left the model in VRAM, and the next load ran out of memory (seen while testing Distributed mode: a model is loaded on a node without room instead of evicting there #13366). The node unload endpoint was not affected, because it also sendsbackend.stopby name.Signed commits