Repository navigation
fix(desktop): wait out a held engine lock in the launch and setup installs - #1105
Merged
Merged
Conversation
…talls models update never waits for the engine operation lock. At launch the Studio shell's first call can hold it while starting or installing Core, so the launch install failed within seconds and left a red Download failed card until Retry, with the model not started. The launch's and the setup's install now retry while the refusal is the lock, for up to five minutes. Settings still answers at once.
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
At launch, a profile on Atomic Core with no engine installed yet could show a red "Download failed · Local engine · Another engine operation is running" card a few seconds after the window opened. It stayed until someone pressed Retry, and the model did not start.
Now the install the app runs by itself (the launch's and the setup's) tries again every 3 seconds while the engine lock is held, for up to 5 minutes. A real failure, a stop, or the end of the wait are returned as before. The install from Settings still says at once that the engine is taken.
Why
models updatenever waits for the engine lock (installCoreBackend,waitMs: 0). That is the right answer for someone who asked for it, and it stays as it is. At launch nobody asked: the Studio shell's load-timerefreshDirsreachesensureStudioCore, which takes the same lock and starts Core, downloading it first when there is no copy on disk. The launch install then lost that race.The race is widest on a build with no bundled Core. In a packaged app it is narrower, and it needs a managed local route with the model on disk and no backend (a migrated config, a removed backend).
Agent code in
src/is not touched.How it was verified
core/folder.agent.logcarried the refusal, and one Retry cleared it.desktop/test/engine-busy-retry.test.mjs: retry until success, a real failure returned at once, the wait limit, a stop during the wait. One test reads the refusals fromcore-operation.ts, so a rewording there fails it. One test pins which installs wait.Left out
refreshDirsstill starts Core on every window load, also for people on a cloud route who never open Studio.models updatestill tries to retire an idle Core, so a retry can close the Core Studio just started. The next call starts it again.