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.
Follow-up to #113 / #114. Low priority.
The retry added in #114 restarts each attempt from byte zero.
artifact::download_oncebuffers the whole body via
resp.bytes()and writes once, so an abort at 10MB of 11MBmeans 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:
Rangeand replies200rather than206(start over)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.