auto_update: Offload update installation to background thread - #58767
Merged
Conversation
Veykril
reviewed
Jun 8, 2026
Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
Contributor
Collaborator
Author
|
zed/crates/auto_update/src/auto_update.rs Lines 1161 to 1185 in f99fe5d
Revert of the update changes? Or any other suggestions? |
Member
|
lets gate the |
lingyaochu
commented
Jun 8, 2026
| Ok(installer_dir.path().join(filename)) | ||
| } | ||
|
|
||
| #[cfg_attr(test, allow(dead_code))] |
Collaborator
Author
There was a problem hiding this comment.
This line is added to make the script/clippy happy
Veykril
approved these changes
Jun 8, 2026
Veykril
enabled auto-merge
June 8, 2026 09:19
TomPlanche
pushed a commit
to TomPlanche/zed
that referenced
this pull request
Jun 8, 2026
…dustries#58767) Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Closes zed-industries#55279 When auto-updating, Zed first downloads the update and then performs the installation. On each platform, this installation phase runs external commands that spawn new processes. These operations can block the thread they run on—especially under heavy system load or when security/antivirus software is active. (An analysis of the blockages on Windows is documented in zed-industries#55279 (comment)). This PR moves the installation process to a background thread. This ensures that even if process spawning block, the main UI thread remains responsive. Release Notes: - Fixed a UI freeze that could occur when installing auto-updates. --------- Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
This was referenced Jun 18, 2026
Closed
Vlaaaaaaad
pushed a commit
to Vlaaaaaaad/zed
that referenced
this pull request
Jul 7, 2026
…#60528) The unmount of the update disk image was made async-and-detached in zed-industries#38867, which introduced a race: the installer TempDir was dropped (running remove_dir_all) while the DMG was still mounted inside it. The removal failed silently, leaking a zed-auto-update* dir containing the ~140 MB DMG in /private/var/folders on every update. Now the unmount is awaited before the temp dir is dropped (installation already runs on the background executor since zed-industries#58767, so this no longer blocks the UI), with the Drop impl kept as a safety net for early exits and cancellation. Additionally, stale installer dirs older than 24 hours are swept from the temp dir when update polling starts, so existing accumulated leaks get reclaimed. Closes FR-104 Closes zed-industries#58835 Release Notes: - Fixed the macOS auto-updater leaking a copy of the downloaded update in the system temp directory on every update, and added cleanup of previously leaked files.
This was referenced Jul 8, 2026
jonx
pushed a commit
to jonx/zed-aros
that referenced
this pull request
Jul 17, 2026
…dustries#58767) Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Closes zed-industries#55279 When auto-updating, Zed first downloads the update and then performs the installation. On each platform, this installation phase runs external commands that spawn new processes. These operations can block the thread they run on—especially under heavy system load or when security/antivirus software is active. (An analysis of the blockages on Windows is documented in zed-industries#55279 (comment)). This PR moves the installation process to a background thread. This ensures that even if process spawning block, the main UI thread remains responsive. Release Notes: - Fixed a UI freeze that could occur when installing auto-updates. --------- Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
…dustries#58767) Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Closes zed-industries#55279 When auto-updating, Zed first downloads the update and then performs the installation. On each platform, this installation phase runs external commands that spawn new processes. These operations can block the thread they run on—especially under heavy system load or when security/antivirus software is active. (An analysis of the blockages on Windows is documented in zed-industries#55279 (comment)). This PR moves the installation process to a background thread. This ensures that even if process spawning block, the main UI thread remains responsive. Release Notes: - Fixed a UI freeze that could occur when installing auto-updates. --------- Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
…#60528) The unmount of the update disk image was made async-and-detached in zed-industries#38867, which introduced a race: the installer TempDir was dropped (running remove_dir_all) while the DMG was still mounted inside it. The removal failed silently, leaking a zed-auto-update* dir containing the ~140 MB DMG in /private/var/folders on every update. Now the unmount is awaited before the temp dir is dropped (installation already runs on the background executor since zed-industries#58767, so this no longer blocks the UI), with the Drop impl kept as a safety net for early exits and cancellation. Additionally, stale installer dirs older than 24 hours are swept from the temp dir when update polling starts, so existing accumulated leaks get reclaimed. Closes FR-104 Closes zed-industries#58835 Release Notes: - Fixed the macOS auto-updater leaking a copy of the downloaded update in the system temp directory on every update, and added cleanup of previously leaked files.
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.
Self-Review Checklist:
Closes #55279
When auto-updating, Zed first downloads the update and then performs the installation. On each platform, this installation phase runs external commands that spawn new processes. These operations can block the thread they run on—especially under heavy system load or when security/antivirus software is active. (An analysis of the blockages on Windows is documented in #55279 (comment)).
This PR moves the installation process to a background thread. This ensures that even if process spawning block, the main UI thread remains responsive.
Release Notes: