update-status hook shouldn't execute apt-get update every 5 minutes

Bug #1907171 reported by Nobuto Murata
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gnocchi Charm
Fix Released
Undecided
Unassigned
OpenStack Octavia Charm
New
Undecided
Unassigned
charm-ovn-chassis
Triaged
Medium
Unassigned

Bug Description

It may not be this charm specific, but I found the following while troubleshooting other issues.

It seems the charm is executing `apt-get update` twice in one update-status hook. Which means 24 times in one hour with the default update-status interval in Juju. In update-status hooks, the charm shouldn't initiate outbound connections that frequently.

$ juju run --unit ovn-chassis/3 -- hooks/update-status
active
active
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-security InRelease [109 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Hit:5 http://ppa.launchpad.net/openstack-charmers/networking-tools/ubuntu focal InRelease
Get:6 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [694 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [11.3 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [700 kB]
Fetched 1728 kB in 0s (3827 kB/s)
Reading package lists...
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal-security InRelease
Hit:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:5 http://ppa.launchpad.net/openstack-charmers/networking-tools/ubuntu focal InRelease
Reading package lists...
active
active
Synchronizing state of neutron-ovn-metadata-agent.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable neutron-ovn-metadata-agent

Changed in charm-ovn-chassis:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

For future travelers: So this is an artifact of charms.reactive code. In order to fix it, we added https://github.com/openstack/charm-layer-openstack/commit/49b1075506d7625d04a05e2cb232d20ea82f6406 (Add a 'is-update-status-hook' flag to the layer) which could be adapted to work with this charm. This would limit all the handlers to not run in the update-status hook.

Revision history for this message
Aurelien Lourot (aurelien-lourot) wrote (last edit ):
Changed in charm-gnocchi:
status: New → Fix Released
milestone: none → 20.10
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.