update-status hook executes a2enmod unnecessarily

Bug #1907725 reported by Nobuto Murata
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceph RADOS Gateway Charm
New
Undecided
Unassigned
OpenStack Cinder Charm
New
Undecided
Unassigned

Bug Description

This is not a high importance, but similar to LP: #1907171. I see the output from a2enmod always when running update-status hooks.

$ juju run --unit ceph-radosgw/0 -- time hooks/update-status
Considering dependency setenvif for ssl:
Module setenvif already enabled
Considering dependency mime for ssl:
Module mime already enabled
Considering dependency socache_shmcb for ssl:
Module socache_shmcb already enabled
Module ssl already enabled
Module proxy already enabled
Considering dependency proxy for proxy_http:
Module proxy already enabled
Module proxy_http already enabled
Module headers already enabled
active
active
active

real 0m3.377s
user 0m2.690s
sys 0m0.793s

Revision history for this message
Nobuto Murata (nobuto) wrote :

a2enmod is a part of ApacheSSLContext fwiw.

Revision history for this message
Nobuto Murata (nobuto) wrote :

Here is the list of affected charms after a quick scan. It looks like all or most of "classic" openstack charms.

ceph-radosgw
cinder
glance
heat
keystone
neutron-api
nova-cloud-controller
openstack-dashboard

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

The problem is in charm-helpers, in contrib/openstack/context.py in the ApacheSSLContext as Nobutu notes above.

The problem is in the design of Contexts which eagerly do all their computations at module load time (due to the contexts variable being a global variable in the module).

However, lazily loading the contexts may or may not fix this problem as (in some charms) the contexts are used as part of the assess_status message generation.

The ACTUAL solution to this is to defer each of the Context class __call__() function calls until they are first accessed as part of the larger dictionary of contexts. Which might need a bit of re-engineering of how the context is set up, but not how it gets used. The other, is simply to not use contexts in the update_status generation (and this would need to be determined on a case by case basis).

For the ceph-radosgw charm it calls "assess_status(CONFIGS)" on every single call, so it would need a re-design of whether to use the ApacheSSLContext for assess_status.

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.