Comment 9 for bug 1850694

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/rocky)

Reviewed: https://review.opendev.org/692631
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=a90fe1951200ebd27fe74788c0a96c01104ac2cf
Submitter: Zuul
Branch: stable/rocky

commit a90fe1951200ebd27fe74788c0a96c01104ac2cf
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
    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.

    NOTE(artom) Conflict in imports in
    nova/tests/unit/api/openstack/compute/test_shelve.py due to using
    oslo's uuidsentinel as of 8e1ca5bf34f924b9a23ddbcf31ae727a7dcacb20 in
    stein.

    Closes-bug: 1850694
    Change-Id: Ie0b421cd5d3a5781c1dd09fab4ed013ece0f939d
    (cherry picked from commit a423d8b27785623550f401a200b68ca926c0a119)
    (cherry picked from commit 32dbd2f585ef1902478170f3a1153b1f71e81db3)
    (cherry picked from commit 8ee59604dcd9f770286f54e3a39c80f54413c358)