Horizon tenant list call should be cached

Bug #949491 reported by Jake Dahn
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
Gabriel Hurley

Bug Description

When I load any page, and look at the keystone log output, it shows that there are multiple calls being made to /tenants, to get a list of tenants which are authorized for the given token.

I think this is where the call is being made: https://github.com/openstack/horizon/blob/master/horizon/middleware.py#L61

We should probably add caching to this.

Mike Perez (thingee)
Changed in horizon:
assignee: nobody → Mike Perez (thingee)
Devin Carlen (devcamcar)
Changed in horizon:
status: New → Confirmed
importance: Undecided → High
milestone: none → essex-rc1
Jake Dahn (jakedahn)
Changed in horizon:
status: Confirmed → In Progress
assignee: Mike Perez (thingee) → Jake Dahn (jakedahn)
Revision history for this message
Gabriel Hurley (gabriel-hurley) wrote : Re: Horizon tenant list call should be cached...

I'm going to treat this as a request for caching rather than a bug report about the requests in the middleware, since there's already a ticket for that: https://bugs.launchpad.net/horizon/+bug/942074

FWIW, that only makes one request for the tokens (it used to make multiple calls in many cases), however if you're on a page like the syspanel tenants list, the launch instance dialog, the create user dialog, or any other place that makes a separate call to populate a tenant chooser dropdown, etc. then you will see multiple calls and this is correct behavior under the current assumptions in the dashboard.

I've been thinking a lot about the caching problem, though, and it's not simple. We need to cut down on making this tenants call so many times, however we also don't want to find ourselves stuck in a case where a newly-created tenant is inaccessible. This is going to be a tricky task and should be addressed in Folsom.

summary: - Horizon requests tenants for token several times every page request.
+ Horizon tenant list call should be cached...
Changed in horizon:
milestone: essex-rc1 → none
Revision history for this message
Jake Dahn (jakedahn) wrote :

Right now, as far as I can tell, the authorized_tenant attribute on the request.user object is always set to None, and it should actually be used to cache the tenant list for the logged in user.

Devin Carlen (devcamcar)
summary: - Horizon tenant list call should be cached...
+ Horizon tenant list call should be cached
Changed in horizon:
milestone: none → folsom-1
Revision history for this message
Gabriel Hurley (gabriel-hurley) wrote :

The authorized tenants list is set correctly at this point (it was fixed in essex) but there are probably places where it can be put to greater use to reduce extra API calls.

Changed in horizon:
assignee: Jake Dahn (jakedahn) → Gabriel Hurley (gabriel-hurley)
importance: High → Medium
Revision history for this message
Gabriel Hurley (gabriel-hurley) wrote :

This has slowly gotten better over time. This ticket is now too broad for any remaining work. Specific cases where the cached value could be used to greater effect can be tracked separately.

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: folsom-1 → 2012.2
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.