fix(mm): handle any error during installation

Previously we only handled expected error types. If a different error was raised, the install job would end up in an unexpected state where it has failed and isn't doing anything, but its status is still running.

This indirectly prevents the installer threads from exiting - they are waiting for all jobs to be completed, including the failed-but-still-running job.

We need to handle any error here to prevent this.
This commit is contained in:
psychedelicious 2024-03-25 19:07:10 +11:00
parent 3aad6f975b
commit b2ea749c72

View File

@ -457,11 +457,10 @@ class ModelInstallService(ModelInstallServiceBase):
elif job.waiting or job.downloads_done:
self._register_or_install(job)
except InvalidModelConfigException as excp:
self._set_error(job, excp)
except (OSError, DuplicateModelException) as excp:
self._set_error(job, excp)
except Exception as e:
# Expected errors include InvalidModelConfigException, DuplicateModelException, OSError, but we must
# gracefully handle _any_ error here.
self._set_error(job, e)
finally:
# if this is an install of a remote file, then clean up the temporary directory