horizon's nova api should cache extensions list
Bug #1258593 reported by
Rob Raymond
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Dashboard (Horizon) |
Fix Released
|
Medium
|
Yves-Gwenael Bourhis |
Bug Description
Currently nova api code memoize's calls to get extensions from nova. But there is a cache hit only if request arg is the same.
Since get extensions is called in many places and extensions are not dynamic, we should cache more aggressively regardless of request.
Changed in horizon: | |
assignee: | nobody → Rob Raymond (rob-raymond) |
description: | updated |
Changed in horizon: | |
importance: | Undecided → Medium |
milestone: | none → next |
status: | New → Confirmed |
Changed in horizon: | |
assignee: | Rob Raymond (rob-raymond) → nobody |
Changed in horizon: | |
assignee: | nobody → Lin Hua Cheng (lin-hua-cheng) |
Changed in horizon: | |
assignee: | Lin Hua Cheng (lin-hua-cheng) → nobody |
Changed in horizon: | |
assignee: | nobody → Yves-Gwenael Bourhis (yves-gwenael-bourhis) |
Changed in horizon: | |
assignee: | Yves-Gwenael Bourhis (yves-gwenael-bourhis) → Timur Sufiev (tsufiev-x) |
Changed in horizon: | |
assignee: | Timur Sufiev (tsufiev-x) → Yves-Gwenael Bourhis (yves-gwenael-bourhis) |
Changed in horizon: | |
assignee: | Yves-Gwenael Bourhis (yves-gwenael-bourhis) → Daniel Castellanos (luis-daniel-castellanos) |
Changed in horizon: | |
assignee: | Daniel Castellanos (luis-daniel-castellanos) → Yves-Gwenael Bourhis (yves-gwenael-bourhis) |
Changed in horizon: | |
status: | In Progress → Fix Released |
Changed in horizon: | |
milestone: | next → none |
To post a comment you must log in.
I started working on it.
I started by making a new memoization decorator to which I pass the attributes of "request" I want to use for memoization.
the list_extensions method only needs the 'user' attribut of the request.
I noticed the following: The user instance of the request object is always the same... even when logging out and in again...
weakref.ref references the same object when logging out and logging in another user because only the user object's attributes (tenant_id, etc...) are changed.... This means that memoizing on the user will not work unless we instantiate a new user object instead of changing the attribute values.
I'll push a draft soon.