conflict (HTTP 409) incorrect for some cases
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ironic |
Triaged
|
Medium
|
Unassigned |
Bug Description
I think we need to revisit when we should be raising exception.Conflict. This causes an HTTP 409 status in the response. In an IRC chat with Lucas about it [1], Lucas mentioned "usually CONFLICT means another operation is in progress so the request conflicted".
I've encountered two cases recently where we probably should not be returning it:
- when a node is destroyed (deleted) [2], it makes sense for NodeLocked, but not if an instance is associated with a node or the node is in an unexpected state
- if a node is created (or updated) with the name of an existing node, the DuplicateName exception is percolated up.
I think we need to:
1. understand what is a Conflict (to the user) and what isn't
2. find out where we're 'abusing' it and make the appropriate changes
3. this is unclear to me -- if we change the HTTP status, it could break existing deployments that eg, are keying on 'HTTP 409'. How do we deal with this? (Maybe a new microversion?)
For example, using python-
$ ironic node-create -d fake_ipmitool -n foo
+------
| Property | Value |
+------
| uuid | 20374cd3-
| driver_info | {} |
| extra | {} |
| driver | fake_ipmitool |
| chassis_uuid | |
| properties | {} |
| name | foo |
+------
$ ironic node-create -d fake_ipmitool -n foo
A node with name foo already exists. (HTTP 409)
[1] around 2015-06-
Changed in ironic: | |
assignee: | nobody → Ruby Loo (rloo) |
Changed in ironic: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
tags: | added: api |
Changed in ironic: | |
assignee: | Ruby Loo (rloo) → Lucas Alvares Gomes (lucasagomes) |
Changed in ironic: | |
assignee: | Lucas Alvares Gomes (lucasagomes) → nobody |
Changed in ironic: | |
assignee: | nobody → Michael Turek (mjturek) |
Changed in ironic: | |
assignee: | nobody → Joanna Taryma (jtaryma) |
Changed in ironic: | |
status: | Triaged → In Progress |
Changed in ironic: | |
status: | In Progress → Triaged |
assignee: | Joanna Taryma (jtaryma) → nobody |
tags: | added: needs-spec |
We discussed this a bit at our weekly meeting on July 13, starting at 17:23:54: eavesdrop. openstack. org/meetings/ ironic/ 2015/ironic. 2015-07- 13-17.00. log.html
http://