Report client doesn't handle RP create conflict (409) properly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Eric Fried | ||
Ocata |
Fix Committed
|
Medium
|
Eric Fried | ||
Pike |
Fix Committed
|
Medium
|
Eric Fried |
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 SchedulerReport
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_
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_
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_
Changed in nova: | |
importance: | Undecided → Medium |
tags: | added: placement resource-tracker |
Fix proposed to branch: master /review. openstack. org/524263
Review: https:/