Bug 1051548 - [download] continue partial downloads
Summary: [download] continue partial downloads
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: librepo
Version: 20
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: ---
Assignee: Tomas Mlcoch
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-10 14:49 UTC by Elad Alfassa
Modified: 2015-06-29 14:20 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-29 14:20:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Reproducer (1.41 KB, text/x-python)
2014-01-16 11:20 UTC, Tomas Mlcoch
no flags Details

Description Elad Alfassa 2014-01-10 14:49:34 UTC
If I Ctrl+c dnf while it's downloading a package (say because I want to pause the download to use the internet connection to do other things), dnf should attempt to continue the download from where it left off if I run dnf install/update again, rather than redownloading from 0.

Comment 1 Ales Kozumplik 2014-01-10 14:57:11 UTC
thanks! A reasonable proposal though no priority at the moment. we'll keep it in the backlog.

Comment 2 Zdeněk Pavlas 2014-01-14 15:08:17 UTC
This has to be implemented in librepo. Contrary to Yum, DNF does not stat/chksum already existing local .rpm files, so it should be transparent.  Librepo should send a Range: header, and if the server returns partial response, append it to the existing partial file.

Comment 3 Tomas Mlcoch 2014-01-16 11:20:31 UTC
Created attachment 851011 [details]
Reproducer

Hi, librepo already support this feature for some time.
Check the attached reproducer.
All you need is to set a "resume" option to True.

Comment 4 Zdeněk Pavlas 2014-01-16 14:37:35 UTC
Hmm, we set "resume=True" already..

> target = librepo.PackageTarget(
>     po.location, self.pkgdir, ctype_code, csum, po.size, po.baseurl, True,
                                                                       ^^^^

    def __init__(self, relative_url, dest=None, checksum_type=CHECKSUM_UNKNOWN,
                 checksum=None, expectedsize=0, base_url=None, resume=False,
                 progresscb=None, cbdata=None, handle=None, endcb=None,
                 mirrorfailurecb=None):

Comment 5 Tomas Mlcoch 2014-01-16 15:05:39 UTC
So it should work.

Maybe the bug is related to the fact that even when the download is resumed, the progress bar starts at 0 (shows the progress of the remaining part). So it can look like the download starts from the scratch again.

Comment 6 Zdeněk Pavlas 2014-01-16 15:26:31 UTC
Checked that the current DNF indeed resumes downloads..

However, the way librepo reports "resuming" is different from Yum.  When Yum resumes a 1.0 MB download and 0.9 MB were already downloaded, the progress bar starts at 90% and the download size is reported as 1.0 MB (downloading only 100k)

OTOH, librepo starts at 0%, but downloads just 0.1 MB anyway.  Probably, this has to be changed in librepo, since then when all files are correctly downloaded, the total download progress is less than 100%.

Tomas, can we send the correct "downloaded" and "total" values to the progress callback?  The fact that we're resuming a file should be transparent to the upper layers, eg. the total size should not change at all.

Comment 7 Fedora End Of Life 2015-05-29 10:25:46 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 8 Fedora End Of Life 2015-06-29 14:20:02 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.