bug: cover list_models tolerance for stale replica uids#5168
Open
OliverBryant wants to merge 1 commit into
Open
bug: cover list_models tolerance for stale replica uids#5168OliverBryant wants to merge 1 commit into
OliverBryant wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds a new test file xinference/core/tests/test_list_models.py to verify that list_models correctly drops stale model UIDs lacking replica information and returns healthy models. The feedback suggests improving code readability by adding type annotations to DummySupervisor and making the test assertions more robust by verifying the exact size of the returned dictionary.
4da5b92 to
963a3e1
Compare
…orbitsai#5167) A failed model launch (e.g. vLLM engine core init failure) can leave a worker reporting a replica uid the supervisor no longer tracks in _model_uid_to_replica_info. Before xorbitsai#5087 this raised a bare KeyError from list_models, so GET /v1/models returned 500 and hid all healthy models. Add regression tests asserting list_models drops the stale, un-tracked uid instead of raising, and still lists healthy models with the correct replica count.
963a3e1 to
80e95d4
Compare
Collaborator
Author
|
/gemini review |
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
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.
What
Adds regression tests for
SupervisorActor.list_modelsso a failed model launch can no longer breakGET /v1/models.Why (#5167)
When a model launch fails during engine init (e.g. vLLM
Engine core initialization failed), the worker may still report the replica uid viaworker.list_models()while the supervisor has already dropped its_model_uid_to_replica_infoentry. Before #5087,list_modelslooked that uid up directly and raised a bareKeyError('qwen3.5'), soGET /v1/modelsreturned 500 and every healthy model disappeared from the list.#5087 (commit
40e52832c) already fixed the behavior by skipping stale, un-tracked uids, but the path had no test coverage. These tests lock that behavior in.Tests
test_list_models_drops_stale_uid_without_replica_info— worker reports both a healthyqwen3-0and a staleqwen3.5-0left by a failed launch; asserts the stale uid is dropped (noKeyError) andqwen3is still listed with the correct replica count. Reverting the fix: drop stale running models without replica info in supervisor.list_models #5087 guard makes this test fail withKeyError.test_list_models_returns_healthy_models— multi-replica happy-path baseline.Both pass;
pre-commit(black/flake8/isort/mypy/codespell) is green.