Skip to content

Retry streaming Python and bin download errors#15567

Merged
charliermarsh merged 2 commits intomainfrom
konsti/retry-on-python-download-stream-error
Aug 31, 2025
Merged

Retry streaming Python and bin download errors#15567
charliermarsh merged 2 commits intomainfrom
konsti/retry-on-python-download-stream-error

Conversation

@konstin
Copy link
Member

@konstin konstin commented Aug 28, 2025

When there is an error during the streaming download and unpack for Python interpreter and bin installs, we would previously fail, causing a lot of CI flakes on GitHub Actions.

The problem was that the error is not one of the extended IO errors we were previously handling, but a regular reqwest error, nested below layers of errors of other crates processing the stream, including some IO errors. We now handle nested reqwest errors, too.

This surfaced another problem: Our manual retry loop couldn't inform the retry middleware that it already performed the limit of retries, and that the middleware should not retry anymore. While too many retries are more a problem for debugging than for the user, this causes confusing error output. To work around this, we disable the retries in the client and handle all retry errors in our loop.

Fixes #14171

@konstin konstin added the enhancement New feature or improvement to existing functionality label Aug 28, 2025
@konstin konstin temporarily deployed to uv-test-registries August 28, 2025 09:11 — with GitHub Actions Inactive
@konstin konstin force-pushed the konsti/retry-on-python-download-stream-error branch from 553868f to 6dbb735 Compare August 28, 2025 09:20
@konstin konstin temporarily deployed to uv-test-registries August 28, 2025 09:22 — with GitHub Actions Inactive
@konstin konstin marked this pull request as ready for review August 28, 2025 09:22
@konstin konstin force-pushed the konsti/retry-on-python-download-stream-error branch from 6dbb735 to 7bb957d Compare August 28, 2025 10:16
@konstin konstin temporarily deployed to uv-test-registries August 28, 2025 10:19 — with GitHub Actions Inactive
@konstin konstin force-pushed the konsti/retry-on-python-download-stream-error branch from 7bb957d to 5b4f8dc Compare August 28, 2025 10:56
@konstin konstin temporarily deployed to uv-test-registries August 28, 2025 10:57 — with GitHub Actions Inactive
@konstin konstin force-pushed the konsti/retry-on-python-download-stream-error branch from 5b4f8dc to 8883092 Compare August 28, 2025 11:12
@konstin konstin temporarily deployed to uv-test-registries August 28, 2025 11:15 — with GitHub Actions Inactive
When there is an error during the streaming download and unpack for Python interpreter and bin installs, we would previously fail, causing a lot of CI flakes on GitHub Actions.

The problem was that the error is not one of the extended IO errors we were previously handling, but a regular reqwest error, nested below layers of errors of other crates processing the stream, including some IO errors. We now handle nested reqwest errors, too.

This surfaced another problem: Our manual retry loop couldn't inform the retry middleware that it already performed the limit of retries, and that the middleware should not retry anymore. While too many retries are more a problem for debugging than for the user, this causes confusing error output. To work around this, we disable the retries in the client and handle all retry errors in our loop.

Fixes #14171
@konstin konstin force-pushed the konsti/retry-on-python-download-stream-error branch from 8883092 to ff8b7da Compare August 28, 2025 11:21
@konstin konstin temporarily deployed to uv-test-registries August 28, 2025 11:24 — with GitHub Actions Inactive
@charliermarsh charliermarsh enabled auto-merge (squash) August 31, 2025 14:57
@charliermarsh charliermarsh merged commit 22f80ca into main Aug 31, 2025
157 checks passed
@charliermarsh charliermarsh deleted the konsti/retry-on-python-download-stream-error branch August 31, 2025 15:07
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Sep 5, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.8.14` -> `0.8.15` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>astral-sh/uv (astral-sh/uv)</summary>

### [`v0.8.15`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0815)

[Compare Source](astral-sh/uv@0.8.14...0.8.15)

##### Python

- Upgrade SQLite 3.50.4 in CPython builds for [CVE-2025-6965](GHSA-2m69-gcr7-jv3q) (see also [python/cpython#137134](python/cpython#137134))

##### Enhancements

- Add `uv auth` commands for credential management ([#&#8203;15570](astral-sh/uv#15570))
- Add pyx support to `uv auth` commands ([#&#8203;15636](astral-sh/uv#15636))
- Add `uv tree --show-sizes` to show package sizes ([#&#8203;15531](astral-sh/uv#15531))
- Add `--python-platform riscv64-unknown-linux` ([#&#8203;15630](astral-sh/uv#15630))
- Add `--python-platform` to `uv run` and `uv tool` ([#&#8203;15515](astral-sh/uv#15515))
- Add `uv publish --dry-run` ([#&#8203;15638](astral-sh/uv#15638))
- Add zstandard support for wheels ([#&#8203;15645](astral-sh/uv#15645))
- Allow registries to pre-provide core metadata ([#&#8203;15644](astral-sh/uv#15644))
- Retry streaming Python and binary download errors ([#&#8203;15567](astral-sh/uv#15567))

##### Bug fixes

- Fix settings rendering for `extra-build-dependencies` ([#&#8203;15622](astral-sh/uv#15622))
- Skip non-existent directories in bytecode compilation ([#&#8203;15608](astral-sh/uv#15608))

##### Error messages

- Add error trace to invalid package format ([#&#8203;15626](astral-sh/uv#15626))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS45My4zIiwidXBkYXRlZEluVmVyIjoiNDEuOTMuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or improvement to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python installation fails during streamed unpack with connection reset error

3 participants