Inappropriate HTTP error status from os-server-external-events
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| OpenStack Compute (nova) |
Fix Released
|
Undecided
|
Eric Fried | ||
Bug Description
The handling of os-server-
* If all events are successfully handled, it should return HTTP 200.
* If no event is successfully handled, it should return HTTP 404.
* If some are handled successfully but not all, it should return HTTP 207, with per-event status codes.
However, when Cyborg sends a single event for a single instance, and that instance is not yet associated with a host [*], the 'else' clause in Line 137 [1] will set HTTP 207 as return code; but, since accepted_events is [] in Line 146, that will throw an exception and return 404. IOW, the expected return is 207 but the actual return is 404.
This has been discussed in IRC [2]. A patch has been proposed [3] to address this.
[*] This happens because Nova calls into Cyborg from the conductor to initiate binding of accelerator requests (ARQs), lets it proceed asynchronously, and waits for the binding notification event in the compute manager. The notification event could come before the compute manager has called self._rt.
| Changed in nova: | |
| assignee: | nobody → Eric Fried (efried) |
| status: | New → In Progress |

> designed to handle multiple events, with the following expected behavior:
> * If all events are successfully handled, it should return HTTP 200.
> * If no event is successfully handled, it should return HTTP 404.
> * If some are handled successfully but not all, it should return HTTP 207, with per-event status > codes.
To be clear, the proposed fix is based on the premise that the second bullet is (has always been) invalid. 207 [1] is specifically designed for this kind of API, and is intended to include the case where *all* components fail (individually -- as opposed to something going wrong at the API level like permissions or malformed inputs).
[1] https:/ /tools. ietf.org/ html/rfc4918# section- 13