update-status hook shouldn't execute apt-get update every 5 minutes
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://
Get:2 http://
Get:3 http://
Get:4 http://
Hit:5 http://
Get:6 http://
Get:7 http://
Get:8 http://
Fetched 1728 kB in 0s (3827 kB/s)
Reading package lists...
Hit:1 http://
Hit:2 http://
Hit:3 http://
Hit:4 http://
Hit:5 http://
Reading package lists...
active
active
Synchronizing state of neutron-
Executing: /lib/systemd/
Changed in charm-ovn-chassis: | |
status: | New → Triaged |
importance: | Undecided → Medium |
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/ 49b1075506d7625 d04a05e2cb232d2 0ea82f6406 (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.