#1880 koji download-build - consider resume downloads by default
Closed: Fixed 4 years ago by tkopecek. Opened 4 years ago by fche.

From https://bugzilla.redhat.com/show_bug.cgi?id=1782983 :

koji 1.19.1 in f30

% koji download-build --latestfrom f32 kernel
works, but then
% koji download-build --latestfrom f32 kernel
downloads all the same files all over again

The attached patch uses the HTTP Range request header to avoid repeated downloading of existing complete or partially-completed files. This makes repeated downloads almost instant.


One complication I didn't consider in that patch: what if the web server refuses the Range: query, and returns a 200 (full content) instead of 206 (partial content) or 416 (already complete). In that case, we should probably reopen the file in 'wb' mode and proceed as before. But I haven't been able to find a koji server that fails to honour Range:, so maybe this not necessary.

@tkopecek please take a look and add your thoughts

Metadata Update from @dgregor:
- Custom field Size adjusted to None

4 years ago

Yep, it an be done. I would definitely check return codes, so we don't have garbage in case, there are some proxies or whatever in the way what ignores range headers.

Metadata Update from @tkopecek:
- Custom field Size adjusted to small (was: None)
- Issue set to the milestone: 1.21
- Issue tagged with: feature

4 years ago

@fche Do you want to convert it to pull request, or should I do it?

I'd be glad to. (I'm just not sure how/whether your testsuite might cover this feature.)

Metadata Update from @tkopecek:
- Issue tagged with: testing-ready

4 years ago

Metadata Update from @jcupova:
- Issue tagged with: testing-done

4 years ago

Login to comment on this ticket.

Metadata
Attachments 1
Attached 4 years ago View Comment
Related Pull Requests
  • #2080 Merged 4 years ago