Skip to content

fix(models): wait for another process's download on Windows - #1753

Merged
kitlangton merged 1 commit into
devfrom
windows-download-lock
Nov 12, 2026
Merged

kitlangton merged 1 commit into
devfrom
windows-download-lock

Conversation

@kitlangton

@kitlangton kitlangton commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

On Windows, a model download now waits for one another process is already running instead of failing at once.
This also fixes waiting_for_another_processs_download_reports_its_partial_bytes, which has failed on every Windows check run since #1735 added it.

❌ Before

  1. hex model install is downloading a model in a terminal (or another Hex is).
  2. Hex starts downloading too, and finds the download lock already held.
  3. ❌ On Windows the lock call returns ERROR_LOCK_VIOLATION, which Rust's io doesn't map to WouldBlock, so Hex took it as a real failure: the download failed rather than waiting, and deleting a model during a download failed with a raw OS error instead of "A model download is in progress".

✅ After

  1. Same.
  2. Same.
  3. ✅ Both lock calls use the check meetings already used (WouldBlock or ERROR_LOCK_VIOLATION), so Windows waits and shows the other process's progress, as macOS and Linux did.
- Err(e) if e.kind() == WouldBlock => wait     // never true on Windows
+ Err(e) if lock_contended(&e) => wait         // one check, moved to durable.rs

👀 Read: nothing tricky; meeting.rs's lock_contended moved to durable.rs unchanged so models and meetings share it.

Checks run

@kitlangton
kitlangton force-pushed the windows-download-lock branch from 7ba7b59 to 2b6a223 Compare November 12, 2026 21:41
@kitlangton
kitlangton merged commit d568f45 into dev Nov 12, 2026
4 checks passed
@kitlangton
kitlangton deleted the windows-download-lock branch November 12, 2026 21:43
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.

1 participant