Comment 16 for bug 1837955

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

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

commit e3b68a1c8bbedd877cfc988898f7e458ab067f28
Author: Erik Olof Gunnar Andersson <email address hidden>
Date: Thu Jul 25 20:19:40 2019 -0700

    Cleanup when hitting MaxRetriesExceeded from no host_available

    Prior to this patch there was a condition when no
    host_available was true and an exception would get
    raised without first cleaning up the instance.
    This causes instances to get indefinitely stuck in
    a scheduling state.

    This patch fixes this by calling the clean up function
    and then exits build_instances using a return statement.

    The related functional regression recreate test is updated
    to show this fixes the bug.

    NOTE(mriedem): There are three changes in this backport. First,
    since bug 1819460 and change I78fc2312274471a7bd85a263de12cc5a0b19fd10
    do not apply to Rocky, _cleanup_when_reschedule_fails is added here.
    Second, the test_bug_1837955 setUp needed to stub notifications
    since change I017d1a31139c9300642dd706eadc265f7c954ca8 is not
    in Rocky to do that in ProviderUsageBaseTestCase. Third, the unit
    test is changed to mock _set_vm_state_and_notify since
    change Ibfb0a6db5920d921c4fc7cabf3f4d2838ea7f421 is not in Rocky
    for compute utils to call notify_about_compute_task_error.

    Change-Id: I6a2c63a4c33e783100208fd3f45eb52aad49e3d6
    Closes-bug: #1837955
    (cherry picked from commit b98d4ba6d54f5ca2999a8fe6b6d7dfcc134061df)
    (cherry picked from commit fcc2b9e33ed2b3d9f469b458e0f46011fe9883ac)