high load of ppa addition fails

Bug #1829681 reported by Wouter van Bommel on 2019-05-19
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Thruk Agent Charm
Undecided
Unassigned

Bug Description

If the addition of the ppa fails, it will re-attempt this every 5 minutes, causing a high load.

The only hint that was given, was the following lines in logging:

unit-thruk-agent-0: 23:46:16 DEBUG unit.thruk-agent/0.juju-log PGP key found (looks like Radix64 format)
unit-thruk-agent-0: 23:46:16 DEBUG unit.thruk-agent/0.juju-log Importing PGP key from keyserver
unit-thruk-agent-0: 23:46:16 DEBUG unit.thruk-agent/0.update-status Warning: apt-key output should not be parsed (stdout is not a terminal)
unit-thruk-agent-0: 23:46:16 DEBUG unit.thruk-agent/0.update-status Executing: /tmp/apt-key-gpghome.es7yvBeasy/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7A207542
unit-thruk-agent-0: 23:46:17 DEBUG unit.thruk-agent/0.update-status gpg: key 4B9A81747A207542: "Launchpad PPA for Canonical Bootstack" not changed
unit-thruk-agent-0: 23:46:17 DEBUG unit.thruk-agent/0.update-status gpg: Total number processed: 1
unit-thruk-agent-0: 23:46:17 DEBUG unit.thruk-agent/0.update-status gpg: unchanged: 1
unit-thruk-agent-0: 23:46:17 DEBUG unit.thruk-agent/0.update-status Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
unit-thruk-agent-0: 23:46:17 DEBUG unit.thruk-agent/0.update-status Get:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
unit-thruk-agent-0: 23:46:17 DEBUG unit.thruk-agent/0.update-status Hit:3 http://ppa.launchpad.net/canonical-bootstack/thruk/ubuntu bionic InRelease
unit-thruk-agent-0: 23:46:17 DEBUG unit.thruk-agent/0.update-status Hit:4 http://ppa.launchpad.net/landscape/19.01/ubuntu bionic InRelease
unit-thruk-agent-0: 23:46:17 DEBUG unit.thruk-agent/0.update-status Get:5 http://archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
unit-thruk-agent-0: 23:46:17 DEBUG unit.thruk-agent/0.update-status Hit:6 http://ppa.launchpad.net/telegraf-devs/ppa/ubuntu bionic InRelease
unit-thruk-agent-0: 23:46:17 DEBUG unit.thruk-agent/0.update-status Get:7 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
unit-thruk-agent-0: 23:46:17 DEBUG unit.thruk-agent/0.update-status Ign:8 https://artifacts.elastic.co/packages/5.x/apt stable InRelease
unit-thruk-agent-0: 23:46:17 DEBUG unit.thruk-agent/0.update-status Hit:9 https://artifacts.elastic.co/packages/5.x/apt stable Release
unit-thruk-agent-0: 23:46:19 DEBUG unit.thruk-agent/0.update-status Fetched 252 kB in 2s (120 kB/s)
unit-thruk-agent-0: 23:46:20 DEBUG unit.thruk-agent/0.update-status Reading package lists...
unit-thruk-agent-0: 23:46:20 INFO unit.thruk-agent/0.juju-log Installing ['thruk', 'pwgen', 'apache2-utils'] with options: ['--option=Dpkg::Options::=--force-confold']
unit-thruk-agent-0: 23:46:20 DEBUG unit.thruk-agent/0.update-status Reading package lists...
unit-thruk-agent-0: 23:46:21 DEBUG unit.thruk-agent/0.update-status Building dependency tree...
unit-thruk-agent-0: 23:46:21 DEBUG unit.thruk-agent/0.update-status Reading state information...
unit-thruk-agent-0: 23:46:21 DEBUG unit.thruk-agent/0.update-status pwgen is already the newest version (2.08-1).
unit-thruk-agent-0: 23:46:21 DEBUG unit.thruk-agent/0.update-status apache2-utils is already the newest version (2.4.29-1ubuntu4.6).
unit-thruk-agent-0: 23:46:21 DEBUG unit.thruk-agent/0.update-status thruk is already the newest version (2.24-2ubuntu6).
unit-thruk-agent-0: 23:46:21 DEBUG unit.thruk-agent/0.update-status 0 upgraded, 0 newly installed, 0 to remove and 160 not upgraded.
unit-thruk-agent-0: 23:46:21 DEBUG unit.thruk-agent/0.update-status active
unit-thruk-agent-0: 23:46:25 DEBUG unit.thruk-agent/0.juju-log Incomplete relation: NEMRelation
unit-thruk-agent-0: 23:46:25 DEBUG unit.thruk-agent/0.update-status inactive
unit-thruk-agent-0: 23:46:25 DEBUG unit.thruk-agent/0.juju-log Incomplete relation: NEMRelation

tags: added: bootstack
Haw Loeung (hloeung) wrote :

Seeing it myself:

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
31267 root 20 0 264416 92436 16292 R 70.1 1.1 2:13.72 add-apt-reposit
 2124 www-data 20 0 110732 42540 5192 S 4.0 0.5 0:00.39 thruk_fastcgi.p

The update-status hook shouldn't really do much and certainly not something as CPU intensive as add-apt-repository.

root 1008 0.0 0.8 1329008 69900 ? Sl Jul05 0:31 \_ /var/lib/juju/tools/unit-thruk-agent-0/jujud unit --data-dir /var/lib/juju --unit-name thruk-agent/0 --debug
root 31196 0.0 0.6 90072 49264 ? S 21:50 0:00 \_ /usr/bin/python /var/lib/juju/agents/unit-thruk-agent-0/charm/hooks/update-status
root 31267 57.9 1.1 264416 92436 ? D 21:50 2:11 \_ /usr/bin/python3 /usr/bin/add-apt-repository --yes ppa:canonical-bootstack/thruk

Changed in thruk-agent-charm:
status: New → Confirmed
Peter Sabaini (peter-sabaini) wrote :

The reason that this can create high load is bug #1311056 -- adding a duplicate '# deb-src ...' entry every time, which seems to result in expensive regex parsing over time

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers