Skip to content

qt-qml: Fix qmlls updating problem with multiple instances - #532

Merged
OrkunTokdemir merged 3 commits into
qt-labs:devfrom
OrkunTokdemir:orkun_qmlls_improve_23_07_2026
Aug 5, 2026
Merged

qt-qml: Fix qmlls updating problem with multiple instances#532
OrkunTokdemir merged 3 commits into
qt-labs:devfrom
OrkunTokdemir:orkun_qmlls_improve_23_07_2026

Conversation

@OrkunTokdemir

@OrkunTokdemir OrkunTokdemir commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Give qmlls more time to stop
    A busy qmlls often needs more than 2 seconds to answer the shutdown
    request. The default stop timeout of vscode-languageclient is 2
    seconds. Because of this, restarts after an update often showed the
    error "Stopping the server timed out". Raise the timeout to 5 seconds.
    Also log this case as a warning, not an error. The client kills the
    server after the timeout anyway, so the restart still works.

  • Install each qmlls version into its own directory
    Many VS Code windows share the same qmlls installation. Before this
    change, they could break each other. Two windows could download to the
    same temp file at the same time. An update could overwrite a qmlls
    binary that was still running. The language server was also stopped
    during the whole download.
    Now every version gets its own directory. A new version is unpacked
    into a temp directory first. Then it is moved into place with one
    atomic rename. If two windows install the same version, the second one
    simply uses the files from the first one. The file current.json points
    to the current version. It is always written atomically. The exe path
    is read fresh from it on every start.
    Old versions are deleted on a best-effort basis. If a directory cannot
    be deleted (for example a running exe on Windows), it is skipped and
    deleted later. The old files/ + release.json layout is converted in
    place, without a new download.
    Other windows watch current.json. When a new version appears, they
    restart their language server silently. The server also keeps running
    during the download now. It only restarts after the new version is
    ready. Because nothing is overwritten anymore, the old ETXTBSY
    workaround was removed.

Related issue

VSCODEEXT-279

Type of change

@OrkunTokdemir OrkunTokdemir changed the title Orkun qmlls improve 23 07 2026 Fix qmlls updating problem with multiple instances Jul 23, 2026
@OrkunTokdemir OrkunTokdemir changed the title Fix qmlls updating problem with multiple instances qt-qml: Fix qmlls updating problem with multiple instances Jul 24, 2026
benchoq
benchoq previously approved these changes Jul 24, 2026
@OrkunTokdemir
OrkunTokdemir force-pushed the orkun_qmlls_improve_23_07_2026 branch 3 times, most recently from 2932d64 to a332a88 Compare July 29, 2026 15:25
Many VS Code windows share the same qmlls installation. Before this
change, they could break each other. Two windows could download to the
same temp file at the same time. An update could overwrite a qmlls
binary that was still running. The language server was also stopped
during the whole download.

Now every version gets its own directory. A new version is unpacked
into a temp directory first. Then it is moved into place with one
atomic rename. If two windows install the same version, the second one
simply uses the files from the first one. The file current.json points
to the current version. It is always written atomically. The exe path
is read fresh from it on every start.

A release tag alone does not identify a build: new builds can be
re-uploaded under the same tag. So the asset upload time (created_at)
is part of a version's identity. A re-uploaded build gets its own
directory, current.json stores the upload time, and the update check
and the manifest watcher compare it too. A migrated release.json keeps
its recorded upload time; without one, the install counts as outdated
and is re-downloaded once.

Old versions are deleted on a best-effort basis. If a directory cannot
be deleted (for example a running exe on Windows), it is skipped and
deleted later. The old files/ + release.json layout is converted in
place, without a new download.

Other windows watch current.json. When a new version appears, they
restart their language server silently. The server also keeps running
during the download now. It only restarts after the new version is
ready. Because nothing is overwritten anymore, the old ETXTBSY
workaround was removed.
A busy qmlls often needs more than 2 seconds to answer the shutdown
request. The default stop timeout of vscode-languageclient is 2
seconds. Because of this, restarts after an update often showed the
error "Stopping the server timed out". Raise the timeout to 5 seconds.
Also log this case as a warning, not an error. The client kills the
server after the timeout anyway, so the restart still works.
unzip() resolved once yauzl finished reading zip entries, but did not
wait for the corresponding destination write streams to flush to disk.
The last file(s) extracted (e.g. qmlls.exe) could still be mid-write
when the caller immediately tried to chmod/spawn it, causing spurious
"not runnable" failures during install.
@OrkunTokdemir
OrkunTokdemir force-pushed the orkun_qmlls_improve_23_07_2026 branch from a332a88 to 1e12e79 Compare August 3, 2026 14:28
@OrkunTokdemir
OrkunTokdemir merged commit 0624164 into qt-labs:dev Aug 5, 2026
8 of 9 checks passed
@OrkunTokdemir
OrkunTokdemir deleted the orkun_qmlls_improve_23_07_2026 branch August 5, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants