yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #47999
[Bug 1551815] Re: Angular policy checks causing too many API calls - slows down pages
Reviewed: https://review.openstack.org/286268
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=6c2eaff49924cef767f0dd6fddff700bccc37838
Submitter: Jenkins
Branch: master
commit 6c2eaff49924cef767f0dd6fddff700bccc37838
Author: Travis Tripp <travis.tripp@xxxxxxx>
Date: Mon Feb 29 13:35:59 2016 -0700
Angular Policy Caching
With angular routing, every time a view / page is shown, any
policy checks are performed again. Policy decisions are fairly
static and should not change as long as the inputs are the same.
This patch makes it so that the results are cached until
a django page reload is triggered (such as when region, user,
project, panel are changed).
Change-Id: Ib8c133f680a7bf0357c26263fb26bb76eb13d65a
Closes-Bug: 1551815
Co-Authored-By: Matt Borland <matt.borland@xxxxxxx>
** Changed in: horizon
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1551815
Title:
Angular policy checks causing too many API calls - slows down pages
Status in OpenStack Dashboard (Horizon):
Fix Released
Bug description:
On Angular panels that use client side routing and also have policy
checks (just about any angular panel with actions), you'll see that
the exact same policy API check is repeated when you switch from the
table listing to the details and back.
Example:
http://127.0.0.1:8005/project/ngimages/
[01/Mar/2016 15:40:53] "POST /api/policy/ HTTP/1.1" 200 17
[01/Mar/2016 15:40:53] "POST /api/policy/ HTTP/1.1" 200 17
[01/Mar/2016 15:40:53] "POST /api/policy/ HTTP/1.1" 200 17
[01/Mar/2016 15:40:53] "GET /api/keystone/user-session/ HTTP/1.1" 200 383
[01/Mar/2016 15:40:53] "GET /api/keystone/svc-catalog/ HTTP/1.1" 200 7404
[01/Mar/2016 15:40:53] "POST /api/policy/ HTTP/1.1" 200 17
Go to the details page:
[01/Mar/2016 15:41:07] "GET /api/glance/images/2c23ae8e-
f7bb-4239-9a94-e011a9b636fc/ HTTP/1.1" 200 429
Click back to the Table:
[01/Mar/2016 15:41:15] "POST /api/policy/ HTTP/1.1" 200 17
[01/Mar/2016 15:41:15] "POST /api/policy/ HTTP/1.1" 200 17
[01/Mar/2016 15:41:15] "POST /api/policy/ HTTP/1.1" 200 17
[01/Mar/2016 15:41:15] "POST /api/policy/ HTTP/1.1" 200 17
The policy being checked will not change between these clicks. These
checks are using the policy service:
https://github.com/openstack/horizon/blob/master/openstack_dashboard/static/app/core
/openstack-service-api/policy.service.js#L105
This service doesn't have caching like the other services (User
session, service catalog, cinder extensions), causing many extra API
hits as the page is navigated.
To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1551815/+subscriptions
References