← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1775308] [NEW] Listing placement usages (total or per resource provider) in a new process can result in a 500

 

Public bug reported:

When requesting /usages or /resource_providers/{uuid}/usages it is
possible to cause a 500 error if placement is running in a multi-process
scenario and the usages query is the first request a process has
received. This is because the methods which provide UsageLists do not
_ensure_rc_cache, resulting in:

  File "/usr/lib/python3.6/site-packages/nova/api/openstack/placement/objects/resource_provider.py", line 2374, in _from_db_object
       rc_str = _RC_CACHE.string_from_id(source['resource_class_id'])
   AttributeError: 'NoneType' object has no attribute 'string_from_id'

We presumably don't see this in our usual testing because any process
has already had other requests happen, setting the cache.

For now, the fix is to add the _ensure_rc_cache call in the right
places, but long term if/when we switch to the os-resource-class model
we can do the caching or syncing a bit differently (see
https://review.openstack.org/#/c/553857/ for an example).

** Affects: nova
     Importance: Medium
     Assignee: Chris Dent (cdent)
         Status: Triaged


** Tags: placement

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1775308

Title:
  Listing placement usages (total or per resource provider) in a new
  process can result in a 500

Status in OpenStack Compute (nova):
  Triaged

Bug description:
  When requesting /usages or /resource_providers/{uuid}/usages it is
  possible to cause a 500 error if placement is running in a multi-
  process scenario and the usages query is the first request a process
  has received. This is because the methods which provide UsageLists do
  not _ensure_rc_cache, resulting in:

    File "/usr/lib/python3.6/site-packages/nova/api/openstack/placement/objects/resource_provider.py", line 2374, in _from_db_object
         rc_str = _RC_CACHE.string_from_id(source['resource_class_id'])
     AttributeError: 'NoneType' object has no attribute 'string_from_id'

  We presumably don't see this in our usual testing because any process
  has already had other requests happen, setting the cache.

  For now, the fix is to add the _ensure_rc_cache call in the right
  places, but long term if/when we switch to the os-resource-class model
  we can do the caching or syncing a bit differently (see
  https://review.openstack.org/#/c/553857/ for an example).

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


Follow ups