Bugfix: Check for pending model loads before re-attempting#53
Merged
Conversation
haraschax
reviewed
Jun 10, 2026
Contributor
|
This just fixes the blocking nature of the follow-up requests, not the original load request? |
haraschax
reviewed
Jun 10, 2026
| def load_triton_model(client: InferenceServerClient, model: str, config: ModelConfig): | ||
| def load_triton_model(client: InferenceServerClient, model: str, config: ModelConfig, load_timeout = 60): | ||
| if _is_model_loading(client, model): | ||
| # If model is loading, wait at most load_timeout for it to finish |
Contributor
There was a problem hiding this comment.
this comment doesn't really add anything for me, code seems sellf-explanatory.
haraschax
reviewed
Jun 10, 2026
| def load_triton_model(client: InferenceServerClient, model: str, config: ModelConfig, load_timeout = 60): | ||
| if _is_model_loading(client, model): | ||
| # If model is loading, wait at most load_timeout for it to finish | ||
| deadline = time.time() + load_timeout |
Contributor
There was a problem hiding this comment.
time.time isn't monotonic. time.perf_counter is
Contributor
Author
|
Correct, however the original load request can be made with a very short timeout now to avoid the 30 second threshold that miniray uses to determine if a canceled job is canceled |
haraschax
reviewed
Jun 10, 2026
| # If model is loading, wait at most load_timeout for it to finish | ||
| deadline = time.time() + load_timeout | ||
| while time.time() < deadline and _is_model_loading(client, model): | ||
| time.sleep(min(5, load_timeout / 5)) |
Contributor
There was a problem hiding this comment.
This seems like a very random choice of sleep time and difficult to read. Why not just do time.sleep(5)?
8915266 to
a74d079
Compare
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.
This fixes a group of bugs that exhibited the following behavior:
This change prevents load requests from being issued when a model of that name is already being loaded. Furthermore, retry attempts now poll instead of blocking at the endpoint, which makes them now cancel-able by miniray.