Skip to content

fix(server): avoid phantom router entry on proxy last-used bump#155

Merged
marksverdhei merged 1 commit into
htfrom
fix/154-proxy-last-used-find
Jul 10, 2026
Merged

fix(server): avoid phantom router entry on proxy last-used bump#155
marksverdhei merged 1 commit into
htfrom
fix/154-proxy-last-used-find

Conversation

@marksverdhei

Copy link
Copy Markdown

What

Fixes #154 by changing server_models::proxy_request to update last_used via mapping.find(name) instead of mapping[name]. If the model entry disappears during a concurrent reload/remove race, the bump is skipped instead of default-inserting an empty instance_t.

Why

proxy_request resolves metadata before proxying, then optionally bumps LRU state under the mutex. The old operator[] access could create a phantom UNLOADED model entry if the canonical model was erased between those steps. That phantom could appear in /models and later drive an empty-preset child spawn.

Validation

  • git diff --check
  • cmake --build build --target llama-server -j 8
  • ./build/bin/llama-server --version

@marksverdhei marksverdhei marked this pull request as ready for review July 10, 2026 11:44
@marksverdhei marksverdhei merged commit 798cf6c into ht Jul 10, 2026
9 checks passed
@marksverdhei marksverdhei deleted the fix/154-proxy-last-used-find branch July 10, 2026 11:44
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.

Router: proxy_request uses mapping[name] operator[] → phantom entry if model erased mid-request (use find())

1 participant