-
Notifications
You must be signed in to change notification settings - Fork 29.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extension install can be corrupted due to cleanup while extension is installing #181671
Comments
This matches my setup, as someone who has been experiencing this problem with the Copilot extension. I have 63 extensions synced to my Codespace. My workaround has been to take a zip of the Copilot extension, drag-n-drop it into my Codespace, and unzip it over top of the existing extension: |
This is caused by https://github.com/microsoft/vscode/pull/176663/files#diff-ea2598061ccd634fa22f0e32765b8ea0e2a659d81ebb758278aaa31a76a43feeR239 that delayed extension clean up to later in time. Even though it was caused by above change, the fix here is to undo the change that introduced removing generated folders. Because, I was assuming deleting an extension folder is not atomic and therefore causing partial deletes and hence changed deleting to rename to generated folder and delete. Therefore I have a task to clean up generated folders. I learned that the |
This is a pure timing issue when the extension installation starts before the clean up and the clean up got triggered while extension is being extracted. @jkeech You said that you can see it consistently? Can you please share with which repo it happens? |
#181671 use tmp path for extracted extensions
@sandy081 I don't think the repo matters very much, but I was able to reproduce on a small sample repo jkeech/simple-server using a 2-core codespace. I've also heard multiple internal reports of this happening on GitHub's much larger monorepo. In both cases, the Copilot extension which is being installed is brought in by Settings Sync, and it's such a large extension that I think it's more likely to run into this timing issue since it takes a few seconds to extract. |
I tried to repro it with couple of repos and it did not happen to me. I know when it can happen and I have the fix. But I would like to know if there is a consistent way to repro it so that I can verify the fix. BTW I tried reproing with your sample repo jkeech/simple-server and the bug did not happen to me. |
#181671 cleanup only generated folders for removed extensions
#181671 cleanup only generated folders for removed extensions
Pushed a tactical fix for recovery - clean up task (deleting generated folders) only deletes the generated folders tagged with removal of extension. |
To verify:
|
Can you please share shared process log while reproducing? |
I confused restarting with reloading. VS Code Stable LGTM. I still need to verify Insiders. |
Does this issue occur when all extensions are disabled?: No, related to extension installation
Version: 1.78.0 (Universal)
Commit: 252e546
Date: 2023-05-03T20:11:00.813Z
Electron: 22.4.8
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin arm64 22.4.0
Sandboxed: No
Steps to Reproduce:
I've verified that the files on disk are only partially there for the extension. Manually inspecting the VSIX content shows that there are more files that are not present on disk. Note in the screenshot below that there is no
extension.js
file on disk.Looking at the extension extraction trace logs, it looks like the issue is that the temporary generated folder which is being used for the Copilot extension extraction is deleted in the middle of the extraction process. This deletes the files that were initially extracted. The folder is then recreated almost immediately as additional files are extracted. The result is that the extension install is corrupted with some of the earlier extracted files missing.
This might be related to the cleanup code that was added back in February in #173484. cc @sandy081
The text was updated successfully, but these errors were encountered: