Skip to content

cli: dira update re-downloads the whole archive on retry instead of resuming with Range #116

Description

@azlekov

Follow-up to #113 / #114. Low priority.

The retry added in #114 restarts each attempt from byte zero. artifact::download_once
buffers the whole body via resp.bytes() and writes once, so an abort at 10MB of 11MB
means attempt 2 re-pulls all 11MB.

That is worst exactly where the bug lives: on a lossy or TLS-inspecting link, a full
re-pull is more exposed to a second abort than a short resume would be, and each attempt
burns full bandwidth.

Suggested shape

On retry, send Range: bytes=<already-received>- and append to the partial file.

Requires switching from buffer-then-write to streaming chunks to a file handle, which is
why it was deliberately kept out of #114:

  • track bytes written per attempt
  • handle a server that ignores Range and replies 200 rather than 206 (start over)
  • guarantee a partial file can never reach the sha256 check — the checksum verification
    is the safety net, and this changes how bytes land on disk

Priority

Low. The retry alone makes the reported incident invisible; this is an optimization for
slow or lossy links, not a correctness gap. Recorded as a known gap in
.zavet/specs/distribution-and-update.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions