Public bug reported:

policy.init() checks whether the rule cache is populated and valid, and
if not reloads the policy cache from the policy.json file.

As the current code runs init() each time a policy is checked or enforced, list 
operations will call init() several times (*)
If policy.json is updated while a response is being generated, this will lead 
to a situation where some item are processed according to the old policies, and 
other according to the new ones, which would be wrong.

Also, init() checks the last update time of the policy file, and
repeating this check multiple time is wasteful.

A simple solution would be to explicitly call policy.init from
api.v2.base.Controller in order to ensure the method is called only once
per API request.


(*) a  GET /ports operation returning 1600 ports calls policy.init()
9606 times

** Affects: neutron
     Importance: Medium
     Assignee: Salvatore Orlando (salvatore-orlando)
         Status: In Progress


** Tags: api havana-backport-potential icehouse-backport-potential

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1302611

Title:
  policy.init called too many time for each API request

Status in OpenStack Neutron (virtual network service):
  In Progress

Bug description:
  policy.init() checks whether the rule cache is populated and valid,
  and if not reloads the policy cache from the policy.json file.

  As the current code runs init() each time a policy is checked or enforced, 
list operations will call init() several times (*)
  If policy.json is updated while a response is being generated, this will lead 
to a situation where some item are processed according to the old policies, and 
other according to the new ones, which would be wrong.

  Also, init() checks the last update time of the policy file, and
  repeating this check multiple time is wasteful.

  A simple solution would be to explicitly call policy.init from
  api.v2.base.Controller in order to ensure the method is called only
  once per API request.


  (*) a  GET /ports operation returning 1600 ports calls policy.init()
  9606 times

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1302611/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to