Autoupdate should be less frequent and more randomly distributed

Bug #1537793 reported by Bret Barker
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snappy
Fix Released
Critical
Unassigned
snapd (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
Fix Released
Undecided
Unassigned

Bug Description

Currently the autoupdate timer (snappy/debian/snappy-autopilot.timer) is set to hourly with a 15 minute accuracy.

As snappy will be included in 16.04 desktops (millions of them), this rate has the potential to seriously overload the Click Package Index service. I suggest changing this to 3 times per day, randomly distributed across 24hr on a per host basis so we don't get top-of-the hour thundering herds.

Further rationale is to also avoid having updates downloaded by all hosts within the first hour of release, since gradual/staged updates are not implemented for snaps.

Revision history for this message
Bret Barker (noise) wrote :

We are getting close to 16.04 release and really need this changed prior to that. Can someone please take a look at this?

Revision history for this message
Michael Vogt (mvo) wrote :
Changed in snappy:
status: New → Fix Committed
importance: Undecided → Critical
Michael Vogt (mvo)
Changed in snappy:
status: Fix Committed → Fix Released
Revision history for this message
Michael Vogt (mvo) wrote :

There is a regression here and we currently only randomize by 2h: https://github.com/snapcore/snapd/blob/master/debian/snapd.refresh.timer

We could change to what apt is doing: https://github.com/Debian/apt/blob/master/debian/apt-daily.timer or we could use the previous commit from John: https://github.com/ubuntu-core/snappy/commit/7669466838dd1227068abc1a8bb363cd86333c50

Changed in snappy:
status: Fix Released → In Progress
Revision history for this message
Michael Vogt (mvo) wrote :
Revision history for this message
Chris J Arges (arges) wrote : Please test proposed package

Hello Bret, or anyone else affected,

Accepted snapd into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/snapd/2.0.8 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in snapd (Ubuntu):
status: New → Fix Released
Changed in snapd (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Bret Barker (noise) wrote :

Michael,

Just wanted to clarify one thing - will the 4x daily checks happen for every user of 16.04 desktop or only those that have installed at least 1 snap (and thus the core snap as well)?

Revision history for this message
Federico Gimenez (fgimenez) wrote :
Download full text (4.3 KiB)

Verified the randomness of the installed timer with snapd from proposed by checking the scheduled times in two consecutive installations:

fgimenez@fgimenez-Standard-PC-i440FX-PIIX-1996:~$ apt-cache policy snapd
snapd:
  Installed: 2.0.8
  Candidate: 2.0.8
  Version table:
 *** 2.0.8 500
        500 http://archive.ubuntu.com/ubuntu xenial-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     2.0.5 500
        500 http://es.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
     2.0.2 500
        500 http://es.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
fgimenez@fgimenez-Standard-PC-i440FX-PIIX-1996:~$ sudo systemctl status snapd.refresh.timer
● snapd.refresh.timer - Timer to automatically refresh installed snaps
   Loaded: loaded (/lib/systemd/system/snapd.refresh.timer; enabled; vendor preset: enabled)
   Active: active (waiting) since lun 2016-06-13 09:13:27 CEST; 9s ago

jun 13 09:13:27 fgimenez-Standard-PC-i440FX-PIIX-1996 systemd[1]: snapd.refresh.timer: Adding 1h 36min 19.904959s random time.
jun 13 09:13:27 fgimenez-Standard-PC-i440FX-PIIX-1996 systemd[1]: Started Timer to automatically refresh installed snaps.
jun 13 09:13:27 fgimenez-Standard-PC-i440FX-PIIX-1996 systemd[1]: snapd.refresh.timer: Adding 4h 41min 2.765543s random time.
jun 13 09:13:27 fgimenez-Standard-PC-i440FX-PIIX-1996 systemd[1]: snapd.refresh.timer: Adding 2h 22min 46.565780s random time.
fgimenez@fgimenez-Standard-PC-i440FX-PIIX-1996:~$ sudo apt-get remove --purge snapd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-21 linux-headers-4.4.0-21-generic linux-image-4.4.0-21-generic linux-image-extra-4.4.0-21-generic
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  snapd*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 22,1 MB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 244530 files and directories currently installed.)
Removing snapd (2.0.8) ...
Warning: Stopping snapd.service, but it can still be activated by:
  snapd.socket
Purging configuration files for snapd (2.0.8) ...
dpkg: warning: while removing snapd, directory '/snap' not empty so not removed
dpkg: warning: while removing snapd, directory '/var/snap' not empty so not removed
dpkg: warning: while removing snapd, directory '/var/lib/snapd/snaps' not empty so not removed
dpkg: warning: while removing snapd, directory '/var/lib/snapd/desktop' not empty so not removed
Processing triggers for man-db (2.7.5-1) ...
fgimenez@fgimenez-Standard-PC-i440FX-PIIX-1996:~$ sudo apt-get install snapd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-21 linux-headers-4.4.0-21-generic linux-image-4.4.0-21-generic linux-image-extra-4.4.0-21-generic
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  snapd
0 upgraded, 1 newly installed, 0 to remove and 0 not up...

Read more...

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package snapd - 2.0.8

---------------
snapd (2.0.8) xenial; urgency=medium

  * New upstream release: LP: #1589534
    - debian: make `snap refresh` times more random (LP: #1537793)
    - cmd: ExecInCoreSnap looks in "core" snap first, and only in
      "ubuntu-core" snap if rev>125.
    - cmd/snap: have 'snap list' display helper message on stderr
      (LP: #1587445)
    - snap: make app names more restrictive.

 -- Michael Vogt <email address hidden> Wed, 08 Jun 2016 07:56:58 +0200

Changed in snapd (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote : Update Released

The verification of the Stable Release Update for snapd has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Michael Vogt (mvo)
Changed in snappy:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.