Repository navigation
Conversation
|
@mudler Review at The new registration in Reproduced with a local gRPC fake implementing The original package suite and |
A backend reached by address has no process, so StartProcess never registered it with the watchdog and LRU and group eviction never saw it loaded. Fixes mudler#12900 Assisted-by: Claude:claude-opus-5-5 Signed-off-by: berce <75228263+bercedev@users.noreply.github.com>
a966502 to
a27bee8
Compare
Description
A model on an address-based external backend (an address in
external_backends.json) was never added to the watchdog'saddressModelMap. Spawned backends get registered inStartProcess, but the address path builds the client with no process and skips that, soEnforceLRULimitandEnforceGroupExclusivitynever saw the model as loaded and loaded the next one next to it.spawnGRPCModelnow registers the model at its address afterLoadModelsucceeds, when there is no process (spawned backends are already registered inStartProcess). Unloading already handles these:deleteProcesscallsFree()and thenwd.Untrack(address)for a model with no process.This PR fixes #12900
Notes for Reviewers
Distributed mode goes through the model router before
spawnGRPCModel, so it isn't affected.With the idle watchdog on, these models are now also freed after the idle timeout, like spawned backends. Before, the watchdog never saw them.
One address still maps to one model, so two models on the same endpoint would overwrite each other's entry, as the issue says. I left that alone.
Tests: new spec in
pkg/model/initializers_external_address_test.gostarts a fake backend on a local port and checks the watchdog lists the model afterspawnGRPCModel. It fails on master and passes here.go test ./pkg/model/(203 specs) andgo vet ./pkg/model/pass, gofmt is clean.AI disclosure: written with Claude Code (
Assisted-bytrailer on the commit). The commit has noSigned-off-by, since CONTRIBUTING.md leaves that to the human submitter.Signed commits