#1880 koji download-build - consider resume downloads by default
Closed: Fixed by tkopecek. Opened 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

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

This version of the patch supports Range-unresponsive 200 codes too.

k2.patch

@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.)

pull-request #1936

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

New PR #2080

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

Commit 2b2cfcf9 fixes this issue

Commit 291f0430 fixes this issue

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/koji/koji/issues/1880

Please continue any further discussion there.

Metadata
Related Pull Requests