# auto_update: Offload update installation to background thread \(\#58767\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/4b974147f27d1351f01debd8a31c9d3cde490a98)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 4b974147f27d1351f01debd8a31c9d3cde490a98

Requested commit: 4b974147f27d1351f01debd8a31c9d3cde490a98

Commit: 4b974147f27d1351f01debd8a31c9d3cde490a98

Tree: 178f5575078bf5793eb31dbf69f8e308ff3fd79a

Author: Xin Zhao

Committer: GitHub

## Message

```
auto_update: Offload update installation to background thread (#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 #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
https://github.com/zed-industries/zed/issues/55279#issuecomment-4638072228).

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>
```

## Parents

- [88e5c6d2faad2a556deb3250357df6f720b7fb3c](https://git.cafe/gitcafe/zed/commit/88e5c6d2faad2a556deb3250357df6f720b7fb3c?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/4b974147f27d1351f01debd8a31c9d3cde490a98?format=markdown)
