Skip to content

fetch: retry downloads with backoff, fetch the root manifest once, and extract concurrently #3

Closed

Description

@zackees

Seen from obs-studio's AppImage build (obs-rust/obs-studio#1047). In `fetch.py` at `b35437f2c`:

  • No retries. `install()` tries each mirror URL in `asset.urls` once, with a 60 s timeout. A single transient error (reset, 5xx, slow mirror) fails the whole image build. Wanted: retry each URL with exponential backoff (for example 3 attempts: 1 s, 4 s, 16 s), for both the archive and the catalog fetches.
  • Root manifest fetched once per tool. `install()` calls `get(root_url)` for every locked tool. Fetch and parse the root `manifest.json` once per `fetch --lock` run.
  • Sequential download and extract. `cli.py` loops over `lock.tools`, and each one downloads, hashes and extracts in series. Nine tools took 51 s locally. Wanted: download concurrently (a bounded pool), and verify the hash and extract (`tarfile r:zst`) concurrently as each download finishes. Destinations are disjoint (`install` paths), so extraction can run in parallel safely. Overlaps with fetch: download the locked tools in parallel, and skip ones the host provides #2, which covers parallel download and skipping host-provided tools; this adds retries and concurrent extraction.

Acceptance

  • RED → GREEN: a test with a fake opener that fails the first N attempts for a URL shows the retry succeeding, and that the attempts are bounded.
  • A test asserts the root manifest is fetched once for a multi-tool lock.
  • A test with a slow fake opener shows downloads overlap: wall time ≈ max, not sum.
  • obs-studio's AppImage image build still fetches every locked dependency.

Activity

  1. zackees commented on Oct 25, 2026

    @zackees
    MemberAuthor

    /ready

    Triage (coordinator): concrete scope in fetch.py/cli.py with RED to GREEN acceptance criteria. Not blocked by #2 (parallel download overlaps; whichever lands second rebases). P2 (transient mirror errors fail obs-studio's AppImage image build, obs-rust/obs-studio#1047), size:M.

  2. added
    P2
    size:M
    ready
    on Oct 25, 2026
  3. zackees commented on Oct 25, 2026

    @zackees
    MemberAuthor

    Claiming: retry with backoff, one root manifest per run, concurrent download+extract in fetch.py/cli.py

    1. RED: tests in tests/test_fetch.py with a fake opener (flaky URL, root-fetch count, slow opener overlap).
    2. GREEN: get/archive download retry 3x (1 s, 4 s, 16 s); install_all parses the root once and runs installs in a bounded thread pool; cli fetch uses it.
      First PR opens within the hour.
  4. self-assigned this
    on Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2readysize:M

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions