RFC2616 section 9.7 status code vs. nova server delete
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Opinion
|
Low
|
stgleb |
Bug Description
In REST client implementation is common good practice, when:
- request causes an synchronous and asynchronous effect , and
- the synchronous operation has any immediately visible effect ie. immediate subsequent request showing any change,
we should emphasize the synchronous behavior in the responses (Status code) (Or responding in way which does not distinguish the two cases).
However if the HTTP method is DELETE, the rule is the opposite!
If the resource on the request URL does not deleted the service MUST NOT response with 204.
"
A successful response SHOULD be 200 (OK) if the response includes an
entity describing the status, 202 (Accepted) if the action has not
yet been enacted, or 204 (No Content) if the action has been enacted
but the response does not include an entity.
" by RFC2616 section 9.7
It means if a DELETE request responded with 204 status code, I MUST get 404 in an immediate subsequent request, unless concurrent operation recreated the resource.
$ nova --debug delete ab0ebda6-
Part of the output in the received order:
-------
REQ: curl -i http://
send: u'DELETE /v2/89a38fe6d31
reply: 'HTTP/1.1 204 No Content\r\n'
header: Content-Length: 0
header: X-Compute-
header: Content-Type: application/json
header: Date: Sat, 02 Mar 2013 18:26:21 GMT
RESP:{'date': 'Sat, 02 Mar 2013 18:26:21 GMT', 'status': '204', 'content-length': '0', 'content-type': 'application/json', 'x-compute-
-------
REQ: curl -i http://
connect: (10.34.69.149, 8774)
send: u'GET /v2/89a38fe6d31
reply: 'HTTP/1.1 200 OK\r\n'
header: X-Compute-
header: Content-Type: application/json
header: Content-Length: 1502
header: Date: Sat, 02 Mar 2013 18:26:21 GMT
RESP:{'status': '200', 'content-length': '1502', 'content-location': u'http://
-------
Changed in nova: | |
status: | New → Confirmed |
importance: | Undecided → Low |
Changed in tempest: | |
assignee: | nobody → Attila Fazekas (afazekas) |
Changed in tempest: | |
status: | New → Confirmed |
importance: | Undecided → Low |
Changed in tempest: | |
assignee: | Attila Fazekas (afazekas) → nobody |
Changed in nova: | |
assignee: | nobody → Jiajun Liu (ljjjustin) |
tags: | added: api |
Changed in nova: | |
status: | In Progress → New |
assignee: | Jiajun Liu (ljjjustin) → nobody |
Changed in nova: | |
assignee: | nobody → stgleb (gstepanov) |
status: | Confirmed → In Progress |
Fix proposed to branch: master /review. openstack. org/52583
Review: https:/