Package: apt-cacher Version: 1.7.4 Severity: wishlist When downloading a package from the Debian archive aptitude keeps it in the directory "/var/cache/apt/archives/partial". Upon completion the file is then moved to the cache in "/var/cache/apt/archives" and then installed. In case of network problems, or if the transfer is interrupted for other reasons, the partial download is preserved. When the file is needed again the download process is simply resumed with a range request.
This instead is what happens, in chronological order, when the aptitude client downloads the package from the apt-cacher proxy. 1. Download request on the client. # aptitude -d install xulrunner-10.0-dbg 2. Processes started on the proxy host: /usr/sbin/apt-cacher [inetd] /usr/sbin/apt-cacher [libcurl] /usr/sbin/apt-cacher [inetd] [http://ftp.de.debian.org/debian/pool/main/i/iceweasel/libmozjs10d-dbg_10.0.6esr-1_amd64.deb] File status on client: -rw-r--r-- 1 root root 5643994 Aug 10 12:11 /var/cache/apt/archives/partial/libmozjs10d-dbg_10.0.6esr-1_amd64.deb File status on the proxy: -rw-r--r-- 1 www-data www-data 5643994 Aug 10 12:11 /var/cache/apt-cacher/packages/debian/libmozjs10d-dbg_10.0.6esr-1_amd64.deb 3. Network failure, the proxy has now no network connection to the Debian mirror. 4. Wait some time to reach timeout. No apt-cacher processes are active any longer. File status on client: -rw-r--r-- 1 root root 5646427 Jul 17 13:32 /var/cache/apt/archives/partial/libmozjs10d-dbg_10.0.6esr-1_amd64.deb Note: the partial download has now the same time-stamp as the one in the Debian mirror. File status on proxy: -rw-r--r-- 1 www-data www-data 5646427 Aug 10 12:13 /var/cache/apt-cacher/packages/debian/libmozjs10d-dbg_10.0.6esr-1_amd64.deb.corrupted Note: the file name changed: ".corrupted" was added as extension. 5. The network connection starts working again after some time. The proxy takes no autonomous actions. 6. Repeat download request on client, # aptitude -d install xulrunner-10.0-dbg aptitude wants to start from where it was forced to suspend: 3% [1 libmozjs10d-dbg 5,646 kB/17.2 MB 33%] File status on client: -rw-r--r-- 1 root root 5646426 Aug 10 12:19 /var/cache/apt-cacher/packages/debian/libmozjs10d-dbg_10.0.6esr-1_amd64.deb Note: again a date change. File status on proxy: -rw-r--r-- 1 www-data www-data 1474249 Aug 10 12:19 /var/cache/apt-cacher/packages/debian/libmozjs10d-dbg_10.0.6esr-1_amd64.deb -rw-r--r-- 1 www-data www-data 5646427 Aug 10 12:13 /var/cache/apt-cacher/packages/debian/libmozjs10d-dbg_10.0.6esr-1_amd64.deb.corrupted The old file (with the ".corrupted" extension) is ignored. A new file is opened and the package downloaded from the start. 7. On the client side aptitude waits in "stalled" status until apt-cacher is reaching the size needed to satisfy its requested range. The user has no idea about what is happening, will just read the word "stalled" for some time and will probably think about a new network failure, if it takes too long he will maybe simply quit aptitude. It would be more efficient if apt-cacher could simply resume suspended downloads. It could, for example, rename the downloaded file to have a ".part" extension until the download is completed; if a client needs a package that is not yet fully downloaded then apt-cacher should only get the missing part with an HTTP range request. To clean the archive from old and obsolete partially downloaded files only the package version string should be used and not, of course, any hash sum. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org