[lunar] Hundreds of calls to lsb_release from apt-check

Bug #1999566 reported by Andreas Hasenack
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
update-notifier (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I'm not entirely sure the bug is in update-notifier, but let's start here.

In lunar, this script is triggering hundreds of calls to "lsb_release -c -s":

# time /usr/lib/update-notifier/apt-check --human-readable
221 updates can be applied immediately.
To see these additional updates run: apt list --upgradable

real 0m7.628s
user 0m5.955s
sys 0m1.115s

Running execsnoop on the host, and apt-check in a lunar lxd container, execsnoop records 222 lsb_release calls.

The exact lsb_release call comes from get_dist() from https://git.launchpad.net/ubuntu/+source/update-manager/tree/UpdateManager/Core/utils.py#n210

Here is a pastebin: https://paste.ubuntu.com/p/FKzBZ3k4nZ/

apt-check's pid is 352917 (line 39 of paste), and that's the PPID of every lsb_release call following that

Related branches

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in update-notifier (Ubuntu):
status: New → Confirmed
Revision history for this message
Renan Rodrigo (renanrodrigo) wrote :

It happens because UpdateManager.Core.UpdateList.UpdateList is being instantiated once per update (so, I see two calls to lsb_release here because I have only 2 upgrades available).

Neverthless it can be improved; I am sending a patch that reduces it to zero calls (:

Revision history for this message
Renan Rodrigo (renanrodrigo) wrote (last edit ):

If the team wants to accept the change, we will need a SRU for https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/2002168 anyway - and this patch can be included, as it affects all the other releases as well.

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.