Repository navigation
fix(model): replace a dangling model_uri cache link for image, audio, video and world models - #5915
Merged
qinxuye merged 1 commit intoOct 30, 2026
Conversation
… video and world models CacheManager._cache_from_uri only checked os.path.exists, which follows the link. When the directory a model_uri pointed to was moved, the old cache symlink stayed behind and os.symlink raised FileExistsError on every later launch. Remove the stale link before relinking, as LLMCacheManager.cache_uri already does.
qinxuye
approved these changes
Oct 30, 2026
qinxuye
left a comment
Contributor
There was a problem hiding this comment.
LGTM. The stale symlink is removed only after the new URI resolves, while valid cache entries retain their existing behavior. Validation: 96 related tests and pre-commit passed, plus 24 cache-entry checks across image, video, audio, and world paths; the new regression fails with the base implementation. Three network-download tests were excluded. The remaining macOS 3.14 CI failure is a Realtime WebSocket handshake returning 503 in a FakeModel test that does not use this cache path.
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.
Image, audio, video and world models with a local
model_uriare linked into~/.xinference/cache/v2/<name>. If the weights are moved and the model is registered again with the new path, the old link is left dangling.CacheManager._cache_from_urionly checksos.path.exists, which follows the link and returns False, so the launch goes on toos.symlinkand fails every time until the link is deleted by hand:LLM, embedding and rerank models already handle this in
LLMCacheManager.cache_uri(#5097). This adds the same step to the generic cache manager: once the new URI resolves, a leftover symlink at the cache path is removed and recreated. A valid link still returns early, and a bad new URI still raises before anything is removed.pytest xinference/model/tests/test_utils.py -k danglingon Linux: fails on main with the FileExistsError above, passes with this change.pytest xinference/model/tests/test_utils.py xinference/model/tests/test_oci_utils.py: 97 passed;test_download_modelscopeandtest_cancelneedmodelscope, which was not installed, and fail the same way on main.pre-commit run --fileson both changed files passes.