)]}'
{"osc_lib/utils/__init__.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1083afa199e322a64ea8f2806785fd5007d63621","unresolved":true,"context_lines":[{"line_number":732,"context_line":"        status \u003d getattr(res, status_field, \u0027\u0027).lower()"},{"line_number":733,"context_line":"        dest_hypervisor \u003d getattr(res, instance_hypervisor_field, \u0027\u0027).lower()"},{"line_number":734,"context_line":"        if status in success_status:"},{"line_number":735,"context_line":"            if src_hypervisor \u003d\u003d dest_hypervisor:"},{"line_number":736,"context_line":"                retval \u003d False"},{"line_number":737,"context_line":"                break"},{"line_number":738,"context_line":"            retval \u003d True"}],"source_content_type":"text/x-python","patch_set":1,"id":"497a7016_aa8a0bce","line":735,"updated":"2021-02-09 16:15:50.000000000","message":"This is racy. If a migration is slow starting or the migration is not accepted, the instance can still be in active state when you get here. It\u0027s return False, but the answer is really only True in the latter case. Rather than checking this, you could check the \u0027/servers/{id}/migrations\u0027 API [1], however, I can\u0027t find a good watch to get the migration record corresponding to a specific request...\n\n[1] https://docs.openstack.org/api-ref/compute/?expanded\u003did312-detail","commit_id":"5dd82266f2e9fd75796bef11c3eb57d6bf666440"},{"author":{"_account_id":32240,"name":"Yadnesh Kulkarni","email":"yadnesh_kulkarni@proton.me","username":"ykulkarn"},"change_message_id":"9c33d98f8d84ecb4b15b41bee31677897b5a21dd","unresolved":true,"context_lines":[{"line_number":732,"context_line":"        status \u003d getattr(res, status_field, \u0027\u0027).lower()"},{"line_number":733,"context_line":"        dest_hypervisor \u003d getattr(res, instance_hypervisor_field, \u0027\u0027).lower()"},{"line_number":734,"context_line":"        if status in success_status:"},{"line_number":735,"context_line":"            if src_hypervisor \u003d\u003d dest_hypervisor:"},{"line_number":736,"context_line":"                retval \u003d False"},{"line_number":737,"context_line":"                break"},{"line_number":738,"context_line":"            retval \u003d True"}],"source_content_type":"text/x-python","patch_set":1,"id":"6f025c85_7dfa5274","line":735,"in_reply_to":"497a7016_aa8a0bce","updated":"2021-02-11 14:12:21.000000000","message":"Here we start monitoring the status of the instance after it has moved into migrating state. The instance status is set to migrating before actual migration tasks start [1]. So even if the migration is slow the instance status would stay in migrating status and we compare this to \"active\" in this function. So how could this lead to a race condition ?\n\nReg comparing the hypervisors, it will only check it after the status of instance has moved from migrating to active. Once the status changes from migrating to active we can be sure that the migration event has ended, the migration is then determined by comparing hyvervisors.\n\nIf you still think this can lead to race condition, can you suggest me some reproducer steps ?\n\n[1] https://opendev.org/openstack/nova/src/branch/master/nova/compute/api.py#L5091","commit_id":"5dd82266f2e9fd75796bef11c3eb57d6bf666440"}]}
