When shelving a server and saving its new SHELVING task state, we
expect the current task state to be None and do not handle any
UnexpectedTaskStateError exceptions that the database layer may throw
at us. In those cases, we return an error 500 to the user, when in
actuality an error 409 conflict would be more appropriate. This
patch makes the API layer handle UnexpectedTaskStateError exceptions
and return a 409 to the user.
Reviewed: https:/ /review. opendev. org/692206 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=a423d8b2778 5623550f401a200 b68ca926c0a119
Committed: https:/
Submitter: Zuul
Branch: master
commit a423d8b27785623 550f401a200b68c a926c0a119
Author: Artom Lifshitz <email address hidden>
Date: Wed Oct 30 14:03:49 2019 -0400
Avoid error 500 on shelve task_state race
When shelving a server and saving its new SHELVING task state, we askStateError exceptions that the database layer may throw tateError exceptions
expect the current task state to be None and do not handle any
UnexpectedT
at us. In those cases, we return an error 500 to the user, when in
actuality an error 409 conflict would be more appropriate. This
patch makes the API layer handle UnexpectedTaskS
and return a 409 to the user.
Closes-bug: 1850694 81c1dd09fab4ed0 13ece0f939d
Change-Id: Ie0b421cd5d3a57