← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1735430] Re: Report client doesn't handle RP create conflict (409) properly

 

** Also affects: nova/pike
   Importance: Undecided
       Status: New

** Also affects: nova/ocata
   Importance: Undecided
       Status: New

** Changed in: nova/ocata
       Status: New => Confirmed

** Changed in: nova/pike
       Status: New => Confirmed

** Changed in: nova/ocata
   Importance: Undecided => Medium

** Changed in: nova/pike
   Importance: Undecided => Medium

-- 
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/1735430

Title:
  Report client doesn't handle RP create conflict (409) properly

Status in OpenStack Compute (nova):
  In Progress
Status in OpenStack Compute (nova) ocata series:
  Confirmed
Status in OpenStack Compute (nova) pike series:
  Confirmed

Bug description:
  POST /resource_providers can fail with conflict (HTTP status 409) for
  (at least) two reasons: A provider with the specified UUID exists;
  *or* a provider with the specified *name* already exists.

  In SchedulerReportClient, _ensure_resource_provider uses helper method
  _create_resource_provider, whose logic goes like this:

   POST /resource_provider { 'uuid': <uuid>, 'name': <name> }
   if 201:
       cool, return the result
   if 409:
       LOG("Another thread created a provider with this *UUID*")
       GET /resource_provider/<uuid>
       if 200:
           cool, return the result
       if 404 or any other error:
           return None
   if any other error:
       return None

  PROBLEM: If a provider exists with the desired *name* (but a different
  UUID), this code will always return None (via that 404 path).

  PROBLEM: Nobody up the stack is checking the return for None.

  What this effectively means is that _ensure_resource_provider...
  doesn't.

  IMO we should raise an exception in these error paths, forcing
  consuming code to handle them explicitly.  But at the very least, any
  code consumuing _ensure_resource_provider needs to validate that it
  succeeds.

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


References