Skip to content

Download and extract vscode-server in temp directory#196

Open
MatthewCash wants to merge 1 commit into
jeanp413:masterfrom
MatthewCash:fix/extract-in-tmpdir
Open

Download and extract vscode-server in temp directory#196
MatthewCash wants to merge 1 commit into
jeanp413:masterfrom
MatthewCash:fix/extract-in-tmpdir

Conversation

@MatthewCash

Copy link
Copy Markdown

If either extraction is interrupted (with $SERVER_SCRIPT at least partially-created) or multiple instances of the installation script run at the same time, the installation process becomes stuck and needs manual intervention.

This fixes the issue by performing the time-consuming installation steps in a per-installation-instance temp directory and only copying the files over once extraction completes.

@daiyam

daiyam commented Apr 2, 2026

Copy link
Copy Markdown
Collaborator

@MatthewCash It doesn't solve

multiple instances of the installation script run at the same time

Shouldn't a directory lock be used to fix that issue?

@MatthewCash

Copy link
Copy Markdown
Author

Shouldn't a directory lock be used to fix that issue?

Yeah probably, I don't use this anymore so if you have a better solution I would close this in favor of yours.

@GitMensch

Copy link
Copy Markdown
Contributor

Also see jeanp413/open-remote-wsl#12 and https://github.com/jeanp413/open-remote-wsl/issues/237 for the issue on the "sister extension".

@GitMensch

Copy link
Copy Markdown
Contributor

Shouldn't this be solved now by the updated setup script which deletes problematic/broken downloads/extracted paths?

Comment thread src/serverSetup.ts

# Check if server script is already installed
if [[ ! -f $SERVER_SCRIPT ]]; then
extract_dir="$(mktemp -d)"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one should be followed by trap 'rm -rf "$extract_dir"; trap - EXIT; exit' EXIT INT HUP and then the final rm -rf below can be dropped (otherwise we'd need to add it to print_install_results_and_exit() as well.
In any case that should be moved after the pushd call below (and may even pushd to extract_dir as that would leave the other parts unchanged - we'd just cp -pr to SERVER_DIR at the end.

...and, as all other vars use upper-case - possibly use EXTRACT_DIR as well.

@GitMensch

Copy link
Copy Markdown
Contributor

presumably made obsolete by #285

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants