fix(Model Manager): refuse to download a file when there's insufficient space #8268
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.
A partial fix for Invoke exhausting disk space, this PR to the DownloadQueueService causes it to refuse to download if the advertised file size is bigger than the available space.
I tried to put this at a higher level, in ModelInstallService._install_remote_model, but despite its attempt to calculate the total_bytes of the install job at that time, in practice it doesn't have that information.
I say partial fix because the model installer copies the files from the temporary directory to the model directory, causing you to temporarily need twice as much disk space—that can be a separate issue.
It is also short-sighted in that if given an install job involving multiple files, it may spend the time to fully download earlier files before realizing it cannot complete all of them.
QA Instructions
free_space
calculation to simulate that condition.Merge Plan
N/A
Checklist
What's New
copy (if doing a release after this PR)