On Monday 12 October 2009 09:10:54 Dave Plater wrote:

> Hi, I'm trying to get libzypp to not delete the /var/adm/mount/

> temporary directory it uses when it downloads packages when retrying a

> download. This is to enable aria2c to use a partial download instead of

> starting from the beginning. I've used gdb to track down the creation of

> the directory in MediaHandler.cc but my time is limited and I would

> appreciate some help as to where the partially downloaded file is

> deleted on retry.

I'm not that familiar with the downloader workflows, but I suppose it's not that easy.

The items are reference counted, so the directory gets deleted together with the last handler accessing it. The same way the (partially) downloaded file gets deleted as the last reference to it drops. Not deleting the directory won't help, as a new handler would create and use it's own dir.

In order to retry an aborted partial download the error handling has to be changed. Currently the error is handled on a too high level. The file, the Handler and even the Fetcher class managing the additional checks (like checksum) are gone when you are asked whether to retry.

A retry will not simply retry the last aria download, but it will restart the complete package providing workflow. Starting with checks for available delta rpms, it will process all the urls available for that repo (in case it has more than one).

So one had to offer a retry at the level of MediaAria, i.e. while the partial file is still accessible. It needs some hack so the PackageProvider can make it's Report class available to MediaAria. Then MediaAria itself could report the partial download and ask whether to try to continue. You would stay inside MediaAria until the file is downloaded completely or failed.

For testing one could auto-coninue a fix number of times and, if this works well, later replace the counter by a report.

--

cu,

Michael Andres

+------------------------------------------------------------------+

Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4

+------------------------------------------------------------------+

Michael Andres YaST Development ma@novell.com

SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)

Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0

+------------------------------------------------------------------+