/usr/bin/snap: downloads restart from the start rather than resuming if they fail due to a bad connection
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
When refreshing a snap using the `/usr/bin/snap` command-line tool, the tool downloads the snap from the Internet. However, my Internet connection is fairly bad, so it's quite common that the download will stall rather than fully completing (i.e. the Internet connection works for some time, but then fails to give any more data).
The `snap` command-line tool reacts to this situation by waiting for some time to see if the download completes, then if the download fails to complete, restarting the download from the beginning. Normally what happens in this case (at least for me) is that the start of the download succeeds again, then the download stalls out again, and so on; this means that `snap` is repeatedly downloading the same portion of the snap over and over, and never sees the whole thing. This in turn makes it very difficult to keep my Ubuntu system updated, because the Internet issues make it impossible for `snap`'s current download algorithm to download enough data to actually do the update.
Instead, what it should be doing (and what I expected it to do) is to cache the portion of the snap that it managed to download, so that on subsequent attempts, it would download only the portion of the snap that it didn't already have. This would make it possible to use a bad Internet connection to update an Ubuntu system.
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: snapd 2.58+22.04
ProcVersionSign
Uname: Linux 5.15.0-69-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.3
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: X-Cinnamon
Date: Tue Apr 11 19:05:07 2023
InstallationDate: Installed on 2019-11-11 (1246 days ago)
InstallationMedia: Ubuntu 18.04.3 LTS "Bionic Beaver" - Release amd64 (20190805)
SourcePackage: snapd
UpgradeStatus: Upgraded to jammy on 2023-02-12 (58 days ago)