)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"c87ce97e39944f44b3d5595f9deb4cee9263f69b","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Delete ARQs by UUID if Cyborg ARQ bind fails."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"See https://review.opendev.org/#/c/673735/46/nova/conductor/manager.py@1632"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: I86c2f00e2368fe02211175e7328b2cd9c0ebf41b"},{"line_number":12,"context_line":"Blueprint: nova-cyborg-interaction"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"df33271e_a34f74bb","line":9,"updated":"2020-04-08 14:56:30.000000000","message":"Huh, this should have been a bug report which would mention the issue that was discovered during code review.","commit_id":"cad737271b9b5e00dd5262a156ae072006f121dc"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"1e34a6670f461dcaf434a624448aba773e8a6112","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Delete ARQs by UUID if Cyborg ARQ bind fails."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"See https://review.opendev.org/#/c/673735/46/nova/conductor/manager.py@1632"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: I86c2f00e2368fe02211175e7328b2cd9c0ebf41b"},{"line_number":12,"context_line":"Blueprint: nova-cyborg-interaction"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"df33271e_2e6de5cb","line":9,"in_reply_to":"df33271e_784a33ac","updated":"2020-04-09 15:05:33.000000000","message":"This was found and addressed during patch review, before the patch series merged. We did not file bugs for other patch review comments either -- we just went by the Gerrit comments.","commit_id":"cad737271b9b5e00dd5262a156ae072006f121dc"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"619e23f5c4186448af7c64b3c0a17d03ac39a71d","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Delete ARQs by UUID if Cyborg ARQ bind fails."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"See https://review.opendev.org/#/c/673735/46/nova/conductor/manager.py@1632"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: I86c2f00e2368fe02211175e7328b2cd9c0ebf41b"},{"line_number":12,"context_line":"Blueprint: nova-cyborg-interaction"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"df33271e_784a33ac","line":9,"in_reply_to":"df33271e_a34f74bb","updated":"2020-04-08 16:40:55.000000000","message":"i think the reason why this was not a bug report was because the arqs are not leaked they are cleaned up without this patch when the instance is deleted but this is cleaner and more correct but ill file the bug and update this in anycase\nbecause its still not good to be consuming the bound devices which is arguable a bug.","commit_id":"cad737271b9b5e00dd5262a156ae072006f121dc"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"f0f630734b255e894afc0da883276acbfc236be2","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Delete ARQs by UUID if Cyborg ARQ bind fails."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"See https://review.opendev.org/#/c/673735/46/nova/conductor/manager.py@1632"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: I86c2f00e2368fe02211175e7328b2cd9c0ebf41b"},{"line_number":12,"context_line":"Blueprint: nova-cyborg-interaction"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"3f4c43b2_dbbd8869","line":10,"updated":"2020-04-14 14:46:14.000000000","message":"https://bugs.launchpad.net/nova/+bug/1872730\nthis is the bug filed for this.\n\nill start reworking this now that im back after the long weekend although i think we will likel hold merging this until after the ussuri release and then backport it as this is not a significant enough bug to justify an RC.","commit_id":"d4719bcb2ff683ea78625a62c6b096bd7b45861f"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"b67bd8bfb351298fa2a0f61ba158687a7bafce35","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Delete ARQs by UUID if Cyborg ARQ bind fails."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"See https://review.opendev.org/#/c/673735/46/nova/conductor/manager.py@1632"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: I86c2f00e2368fe02211175e7328b2cd9c0ebf41b"},{"line_number":12,"context_line":"Blueprint: nova-cyborg-interaction"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"3f4c43b2_d22efba3","line":10,"in_reply_to":"3f4c43b2_dbbd8869","updated":"2020-04-15 07:59:04.000000000","message":"yes, we should cleanup arqs if _create_and_bind_arqs() failed, so I think we should do \"compute_utils.delete_arqs_if_needed(context, instance)\" if we catch the Exception at https://review.opendev.org/#/c/673735/46/nova/conductor/manager.py@1632.","commit_id":"d4719bcb2ff683ea78625a62c6b096bd7b45861f"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"461d7d34b1d7fb1aa7eeb4af04e7fb9b03a1f89f","unresolved":false,"context_lines":[{"line_number":14,"context_line":"unbound ARQs by instance uuid."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"This change modifies build_instances and schedule_and_build_instances"},{"line_number":17,"context_line":"to handel the AcceleratorRequestOpFailed exception raised when binding"},{"line_number":18,"context_line":"fails and clean up instance arqs."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Closes-Bug: #1872730"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"1f493fa4_4e3b7f37","line":17,"range":{"start_line":17,"start_character":14,"end_line":17,"end_character":40},"updated":"2020-04-22 08:04:26.000000000","message":"s/AcceleratorRequestOpFailed/AcceleratorRequestBindingFailed","commit_id":"75e31333629180e37a539b6ae4c778137236348f"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"76733932d65aa2c60bd1dcc41f3d4be12088cc9f","unresolved":false,"context_lines":[{"line_number":14,"context_line":"unbound ARQs by instance uuid."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"This change modifies build_instances and schedule_and_build_instances"},{"line_number":17,"context_line":"to handel the AcceleratorRequestOpFailed exception raised when binding"},{"line_number":18,"context_line":"fails and clean up instance arqs."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Closes-Bug: #1872730"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"1f493fa4_1ec24086","line":17,"range":{"start_line":17,"start_character":14,"end_line":17,"end_character":40},"in_reply_to":"1f493fa4_4e3b7f37","updated":"2020-04-22 12:07:47.000000000","message":"ah yes i forgot to update this.\nthanks","commit_id":"75e31333629180e37a539b6ae4c778137236348f"}],"nova/accelerator/cyborg.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"db80794573f72ccce7e6b19af56a513815d5f760","unresolved":false,"context_lines":[{"line_number":213,"context_line":"             self.ARQ_URL, json\u003dpatch_list)"},{"line_number":214,"context_line":"        if err_msg:"},{"line_number":215,"context_line":"            arq_uuids \u003d bindings.keys()"},{"line_number":216,"context_line":"            self._delete_arqs_by_uuid(arq_uuids)"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"            msg \u003d _(\u0027 Binding failed for ARQ UUIDs: \u0027)"},{"line_number":219,"context_line":"            err_msg \u003d err_msg + msg + \u0027,\u0027.join(arq_uuids)"}],"source_content_type":"text/x-python","patch_set":6,"id":"df33271e_938b7e66","line":216,"updated":"2020-04-09 14:40:37.000000000","message":"Is this really the right thing to do? We\u0027ve got ARQs, and we go to bind them, which fails, and at the end, our ARQs are gone/deleted?\n\nI\u0027m guessing this is baked into bind just because of how things work today, but in terms of this being generally useful in the future, like maybe for a migration, we\u0027d want to just report error and let the caller decide if the right thing to do is delete them, try again, etc.","commit_id":"cad737271b9b5e00dd5262a156ae072006f121dc"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"b67bd8bfb351298fa2a0f61ba158687a7bafce35","unresolved":false,"context_lines":[{"line_number":213,"context_line":"             self.ARQ_URL, json\u003dpatch_list)"},{"line_number":214,"context_line":"        if err_msg:"},{"line_number":215,"context_line":"            arq_uuids \u003d bindings.keys()"},{"line_number":216,"context_line":"            self._delete_arqs_by_uuid(arq_uuids)"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"            msg \u003d _(\u0027 Binding failed for ARQ UUIDs: \u0027)"},{"line_number":219,"context_line":"            err_msg \u003d err_msg + msg + \u0027,\u0027.join(arq_uuids)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f4c43b2_8d3bb8cf","line":216,"in_reply_to":"3f4c43b2_88bc746a","updated":"2020-04-15 07:59:04.000000000","message":"When we execute bind, the arq record has been created in Cybrog and a Resource Provider map has been made. If instance failed to bind, I think it is necessary to perform the deletion of the occupied resources.","commit_id":"cad737271b9b5e00dd5262a156ae072006f121dc"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d156aabd57a2e5b1e297d4546b897f873e1a95f7","unresolved":false,"context_lines":[{"line_number":213,"context_line":"             self.ARQ_URL, json\u003dpatch_list)"},{"line_number":214,"context_line":"        if err_msg:"},{"line_number":215,"context_line":"            arq_uuids \u003d bindings.keys()"},{"line_number":216,"context_line":"            self._delete_arqs_by_uuid(arq_uuids)"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"            msg \u003d _(\u0027 Binding failed for ARQ UUIDs: \u0027)"},{"line_number":219,"context_line":"            err_msg \u003d err_msg + msg + \u0027,\u0027.join(arq_uuids)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f4c43b2_88bc746a","line":216,"in_reply_to":"df33271e_0d773ea2","updated":"2020-04-13 13:43:02.000000000","message":"Having this bind operation delete the arq is like having a filesystem move operation delete the source file even if it doesn\u0027t have permission to write to the new location. Otherwise it should be called bind_or_delete_arqs_on_failure(), which is a silly single operation to have. If we want to try another host, we should be able to do that, or if the code calling this isn\u0027t in a position to try another, then let *it* delete them.","commit_id":"cad737271b9b5e00dd5262a156ae072006f121dc"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"938b8c62dc19658aa03782aaf890013b8cd16eb0","unresolved":false,"context_lines":[{"line_number":213,"context_line":"             self.ARQ_URL, json\u003dpatch_list)"},{"line_number":214,"context_line":"        if err_msg:"},{"line_number":215,"context_line":"            arq_uuids \u003d bindings.keys()"},{"line_number":216,"context_line":"            self._delete_arqs_by_uuid(arq_uuids)"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"            msg \u003d _(\u0027 Binding failed for ARQ UUIDs: \u0027)"},{"line_number":219,"context_line":"            err_msg \u003d err_msg + msg + \u0027,\u0027.join(arq_uuids)"}],"source_content_type":"text/x-python","patch_set":6,"id":"df33271e_6ee7ed13","line":216,"in_reply_to":"df33271e_530bb628","updated":"2020-04-09 15:18:49.000000000","message":"i am currently planning to move the call to _delete_arqs_by_uuid to an exception handeler that catches the AcceleratorRequestOpFailed exception raised below.\n\nfor spwan this will have the same behavior but any other code that then uses bind_arqs can choose to either catch the exception and either delete the arqs or perhaps retry the binding.\n\nif nothing handels the error then the binding would be cleaned up when the vm is deleted by the end user.","commit_id":"cad737271b9b5e00dd5262a156ae072006f121dc"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"229386dc51a74d951bb8952b3c9ee5596b26b81f","unresolved":false,"context_lines":[{"line_number":213,"context_line":"             self.ARQ_URL, json\u003dpatch_list)"},{"line_number":214,"context_line":"        if err_msg:"},{"line_number":215,"context_line":"            arq_uuids \u003d bindings.keys()"},{"line_number":216,"context_line":"            self._delete_arqs_by_uuid(arq_uuids)"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"            msg \u003d _(\u0027 Binding failed for ARQ UUIDs: \u0027)"},{"line_number":219,"context_line":"            err_msg \u003d err_msg + msg + \u0027,\u0027.join(arq_uuids)"}],"source_content_type":"text/x-python","patch_set":6,"id":"df33271e_0d773ea2","line":216,"in_reply_to":"df33271e_6ee7ed13","updated":"2020-04-10 00:22:53.000000000","message":"\u003e if nothing handels the error then the binding would be cleaned up\n \u003e when the vm is deleted by the end user.\n\nHow? Th VM deletion path calls delete_arqs_by_instance(), which deletes the ARQs bound to an instance UUID. But, in this path, the ARQs are not yet bound to an instance UUID on the Cyborg side.","commit_id":"cad737271b9b5e00dd5262a156ae072006f121dc"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"1e34a6670f461dcaf434a624448aba773e8a6112","unresolved":false,"context_lines":[{"line_number":213,"context_line":"             self.ARQ_URL, json\u003dpatch_list)"},{"line_number":214,"context_line":"        if err_msg:"},{"line_number":215,"context_line":"            arq_uuids \u003d bindings.keys()"},{"line_number":216,"context_line":"            self._delete_arqs_by_uuid(arq_uuids)"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"            msg \u003d _(\u0027 Binding failed for ARQ UUIDs: \u0027)"},{"line_number":219,"context_line":"            err_msg \u003d err_msg + msg + \u0027,\u0027.join(arq_uuids)"}],"source_content_type":"text/x-python","patch_set":6,"id":"df33271e_530bb628","line":216,"in_reply_to":"df33271e_73fa3a75","updated":"2020-04-09 15:05:33.000000000","message":"In this error path, ARQs have been created but the attempt to bind has failed. So, how will those created ARQs be deleted? There will not be any notification from Cyborg of a bind-completion event. Other clean up paths in Nova call delete_arqs_by_instance(), but the ARQ is not yet bound to an instance, so that won\u0027t delete these ARQs either.\n\nIn terms of general utility, this call is not idempotent, so one has to be extra careful about potentially calling this multiple times.","commit_id":"cad737271b9b5e00dd5262a156ae072006f121dc"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"eff309b03a54b4a02720fc6ffaf14499174163cc","unresolved":false,"context_lines":[{"line_number":213,"context_line":"             self.ARQ_URL, json\u003dpatch_list)"},{"line_number":214,"context_line":"        if err_msg:"},{"line_number":215,"context_line":"            arq_uuids \u003d bindings.keys()"},{"line_number":216,"context_line":"            self._delete_arqs_by_uuid(arq_uuids)"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"            msg \u003d _(\u0027 Binding failed for ARQ UUIDs: \u0027)"},{"line_number":219,"context_line":"            err_msg \u003d err_msg + msg + \u0027,\u0027.join(arq_uuids)"}],"source_content_type":"text/x-python","patch_set":6,"id":"df33271e_73fa3a75","line":216,"in_reply_to":"df33271e_938b7e66","updated":"2020-04-09 14:48:11.000000000","message":"we could pull this out of bind i guess and handel it in reponce to the excpeiton that is raised.\n\ncyborg has the ablity to unbind ARQs and then bind them to a new host but currently they dont use the unbound state so sunder wanted to prefer deleting and recreating the ARQs if we were to rechsudle instead of unbind and rebind for spawn.\n\nso ya that expected behavior is being backed in here which is likely not correct i can pull this out and hanel the error at the call site by deleing the bindings and then reraising it.","commit_id":"cad737271b9b5e00dd5262a156ae072006f121dc"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"858f1753a020c9a00f901c1e8e52d62c76610baf","unresolved":false,"context_lines":[{"line_number":216,"context_line":"            msg \u003d _(\u0027 Binding failed for ARQ UUIDs: \u0027)"},{"line_number":217,"context_line":"            err_msg \u003d err_msg + msg + \u0027,\u0027.join(arq_uuids)"},{"line_number":218,"context_line":"            raise exception.AcceleratorRequestBindingFailed("},{"line_number":219,"context_line":"                None, arqs\u003darq_uuids, msg\u003derr_msg)"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    def get_arqs_for_instance(self, instance_uuid, only_resolved\u003dFalse):"},{"line_number":222,"context_line":"        \"\"\"Get ARQs for the instance."}],"source_content_type":"text/x-python","patch_set":15,"id":"bf51134e_3a445947","line":219,"range":{"start_line":219,"start_character":16,"end_line":219,"end_character":50},"updated":"2020-07-22 08:04:14.000000000","message":"If you drop the message parameter from the constructor as I suggested then this becomes a lot clearer:\n\n  exception.AcceleratorRequestBindingFailed(msg\u003derr_msg, arqs\u003darq_uuids)","commit_id":"38b7854ea8b3a5304ffbd6162d60acb5b9d8f62c"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"29e75c4e5a8ed4804d1e21b335aec88f0df160af","unresolved":false,"context_lines":[{"line_number":216,"context_line":"            msg \u003d _(\u0027 Binding failed for ARQ UUIDs: \u0027)"},{"line_number":217,"context_line":"            err_msg \u003d err_msg + msg + \u0027,\u0027.join(arq_uuids)"},{"line_number":218,"context_line":"            raise exception.AcceleratorRequestBindingFailed("},{"line_number":219,"context_line":"                None, arqs\u003darq_uuids, msg\u003derr_msg)"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    def get_arqs_for_instance(self, instance_uuid, only_resolved\u003dFalse):"},{"line_number":222,"context_line":"        \"\"\"Get ARQs for the instance."}],"source_content_type":"text/x-python","patch_set":15,"id":"bf51134e_22fed604","line":219,"range":{"start_line":219,"start_character":16,"end_line":219,"end_character":50},"in_reply_to":"bf51134e_3a445947","updated":"2020-07-23 07:00:06.000000000","message":"Done","commit_id":"38b7854ea8b3a5304ffbd6162d60acb5b9d8f62c"}],"nova/conductor/manager.py":[{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"461d7d34b1d7fb1aa7eeb4af04e7fb9b03a1f89f","unresolved":false,"context_lines":[{"line_number":844,"context_line":"                    context, instance.uuid, instance.flavor.extra_specs,"},{"line_number":845,"context_line":"                    host.nodename, resource_provider_mapping)"},{"line_number":846,"context_line":"            except Exception as exc:"},{"line_number":847,"context_line":"                if isinstance(exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":848,"context_line":"                    cyclient \u003d cyborg.get_client(context)"},{"line_number":849,"context_line":"                    cyclient._delete_arqs_by_uuid(exc.arqs)"},{"line_number":850,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027, exc)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f493fa4_593d07ba","line":847,"updated":"2020-04-22 08:04:26.000000000","message":"Seems you missed test case to cover this exception","commit_id":"75e31333629180e37a539b6ae4c778137236348f"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"76733932d65aa2c60bd1dcc41f3d4be12088cc9f","unresolved":false,"context_lines":[{"line_number":844,"context_line":"                    context, instance.uuid, instance.flavor.extra_specs,"},{"line_number":845,"context_line":"                    host.nodename, resource_provider_mapping)"},{"line_number":846,"context_line":"            except Exception as exc:"},{"line_number":847,"context_line":"                if isinstance(exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":848,"context_line":"                    cyclient \u003d cyborg.get_client(context)"},{"line_number":849,"context_line":"                    cyclient._delete_arqs_by_uuid(exc.arqs)"},{"line_number":850,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027, exc)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f493fa4_bec6ac15","line":847,"in_reply_to":"1f493fa4_593d07ba","updated":"2020-04-22 12:07:47.000000000","message":"im not sure if this had testing previously.\nill see how easy it is to add coverage for this i guess.","commit_id":"75e31333629180e37a539b6ae4c778137236348f"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"461d7d34b1d7fb1aa7eeb4af04e7fb9b03a1f89f","unresolved":false,"context_lines":[{"line_number":846,"context_line":"            except Exception as exc:"},{"line_number":847,"context_line":"                if isinstance(exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":848,"context_line":"                    cyclient \u003d cyborg.get_client(context)"},{"line_number":849,"context_line":"                    cyclient._delete_arqs_by_uuid(exc.arqs)"},{"line_number":850,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027, exc)"},{"line_number":851,"context_line":"                self._cleanup_when_reschedule_fails(context, instance, exc,"},{"line_number":852,"context_line":"                     legacy_request_spec, requested_networks)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f493fa4_0eefb784","line":849,"range":{"start_line":849,"start_character":29,"end_line":849,"end_character":49},"updated":"2020-04-22 08:04:26.000000000","message":"Agree, cleanup up arqs by arq_uuids, it\u0027s better than use compute_utils.delete_arqs_if_needed()[1], that if bind fails, then we can cleanup all arq_uuids.\n\n[1]https://opendev.org/openstack/nova/src/branch/master/nova/compute/utils.py#L1554","commit_id":"75e31333629180e37a539b6ae4c778137236348f"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"461d7d34b1d7fb1aa7eeb4af04e7fb9b03a1f89f","unresolved":false,"context_lines":[{"line_number":845,"context_line":"                    host.nodename, resource_provider_mapping)"},{"line_number":846,"context_line":"            except Exception as exc:"},{"line_number":847,"context_line":"                if isinstance(exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":848,"context_line":"                    cyclient \u003d cyborg.get_client(context)"},{"line_number":849,"context_line":"                    cyclient._delete_arqs_by_uuid(exc.arqs)"},{"line_number":850,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027, exc)"},{"line_number":851,"context_line":"                self._cleanup_when_reschedule_fails(context, instance, exc,"},{"line_number":852,"context_line":"                     legacy_request_spec, requested_networks)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f493fa4_ce35cff9","line":849,"range":{"start_line":848,"start_character":20,"end_line":849,"end_character":59},"updated":"2020-04-22 08:04:26.000000000","message":"Can you mova this to the compute.utils file? Like [1], maybe we can set name with delete_arqs_by_uuid().\n\n[1]https://opendev.org/openstack/nova/src/branch/master/nova/compute/utils.py#L1554","commit_id":"75e31333629180e37a539b6ae4c778137236348f"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"2f6ff1b795c41f60c748db7a3b18256216035621","unresolved":false,"context_lines":[{"line_number":846,"context_line":"            except Exception as exc:"},{"line_number":847,"context_line":"                if isinstance(exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":848,"context_line":"                    cyclient \u003d cyborg.get_client(context)"},{"line_number":849,"context_line":"                    cyclient._delete_arqs_by_uuid(exc.arqs)"},{"line_number":850,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027, exc)"},{"line_number":851,"context_line":"                self._cleanup_when_reschedule_fails(context, instance, exc,"},{"line_number":852,"context_line":"                     legacy_request_spec, requested_networks)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f493fa4_956ee192","line":849,"range":{"start_line":849,"start_character":29,"end_line":849,"end_character":49},"in_reply_to":"1f493fa4_07777ed6","updated":"2020-04-26 00:19:07.000000000","message":"\u003e right so i dont think we should have creeated delete_arqs_if_needed\n \u003e in compute utils and i actullly think we likely shoudl move it back\n \u003e to the cybrog module.\n \u003e \n \u003e if we wrap it in a helper that is where i think we should put it.\n \u003e \n \u003e the nova.compaute.utils shoudl not be used outside of the\n \u003e nova.compute module.\n\nYeah, we can move these to the cyborg module, it\u0027s better to encapsulate a function.","commit_id":"75e31333629180e37a539b6ae4c778137236348f"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"76733932d65aa2c60bd1dcc41f3d4be12088cc9f","unresolved":false,"context_lines":[{"line_number":846,"context_line":"            except Exception as exc:"},{"line_number":847,"context_line":"                if isinstance(exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":848,"context_line":"                    cyclient \u003d cyborg.get_client(context)"},{"line_number":849,"context_line":"                    cyclient._delete_arqs_by_uuid(exc.arqs)"},{"line_number":850,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027, exc)"},{"line_number":851,"context_line":"                self._cleanup_when_reschedule_fails(context, instance, exc,"},{"line_number":852,"context_line":"                     legacy_request_spec, requested_networks)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f493fa4_1ee36007","line":849,"range":{"start_line":849,"start_character":29,"end_line":849,"end_character":49},"in_reply_to":"1f493fa4_0eefb784","updated":"2020-04-22 12:07:47.000000000","message":"this does not make sense to me can you explain more.\n\nmy understanding of why sundar added a new function was we could not use delete_arqs_if_needed because \ndelete_arqs_for_instance would only delete bound arqs.\n\nso we cant use compute_utils.delete_arqs_if_needed() as it wont actully do the clean up correctly.\n\nare you suggesting that we shoudl remove the delete_arqs_for_instance function and instead only use\n_delete_arqs_by_uuid in compute_utils.delete_arqs_if_needed()?\n\nthat would intoduce an additional query to cyborg to lookup the uuids or require us to pass them in in other code paths which i dont think makes sense","commit_id":"75e31333629180e37a539b6ae4c778137236348f"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"2af2c8f92291abc1ad50f31937e16b86b579f507","unresolved":false,"context_lines":[{"line_number":846,"context_line":"            except Exception as exc:"},{"line_number":847,"context_line":"                if isinstance(exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":848,"context_line":"                    cyclient \u003d cyborg.get_client(context)"},{"line_number":849,"context_line":"                    cyclient._delete_arqs_by_uuid(exc.arqs)"},{"line_number":850,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027, exc)"},{"line_number":851,"context_line":"                self._cleanup_when_reschedule_fails(context, instance, exc,"},{"line_number":852,"context_line":"                     legacy_request_spec, requested_networks)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f493fa4_6e7aa424","line":849,"range":{"start_line":849,"start_character":29,"end_line":849,"end_character":49},"in_reply_to":"1f493fa4_1ee36007","updated":"2020-04-23 00:09:16.000000000","message":"\u003e are you suggesting that we shoudl remove the delete_arqs_for_instance\n \u003e function and instead only use\n \u003e _delete_arqs_by_uuid in compute_utils.delete_arqs_if_needed()?\n\nNo, I mean, we should wrap a delete_arqs_by_uuid() in compute.utils.py just like delete_arqs_if_needed().","commit_id":"75e31333629180e37a539b6ae4c778137236348f"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"68a2124c837ab10c4d55a2fa24b042160185a6dc","unresolved":false,"context_lines":[{"line_number":846,"context_line":"            except Exception as exc:"},{"line_number":847,"context_line":"                if isinstance(exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":848,"context_line":"                    cyclient \u003d cyborg.get_client(context)"},{"line_number":849,"context_line":"                    cyclient._delete_arqs_by_uuid(exc.arqs)"},{"line_number":850,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027, exc)"},{"line_number":851,"context_line":"                self._cleanup_when_reschedule_fails(context, instance, exc,"},{"line_number":852,"context_line":"                     legacy_request_spec, requested_networks)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f493fa4_07777ed6","line":849,"range":{"start_line":849,"start_character":29,"end_line":849,"end_character":49},"in_reply_to":"1f493fa4_6e7aa424","updated":"2020-04-23 09:56:18.000000000","message":"right so i dont think we should have creeated delete_arqs_if_needed in compute utils and i actullly think we likely shoudl move it back to the cybrog module.\n\nif we wrap it in a helper that is where i think we should put it.\n\nthe nova.compaute.utils shoudl not be used outside of the nova.compute module.","commit_id":"75e31333629180e37a539b6ae4c778137236348f"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"2af2c8f92291abc1ad50f31937e16b86b579f507","unresolved":false,"context_lines":[{"line_number":845,"context_line":"                    host.nodename, resource_provider_mapping)"},{"line_number":846,"context_line":"            except Exception as exc:"},{"line_number":847,"context_line":"                if isinstance(exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":848,"context_line":"                    cyclient \u003d cyborg.get_client(context)"},{"line_number":849,"context_line":"                    cyclient._delete_arqs_by_uuid(exc.arqs)"},{"line_number":850,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027, exc)"},{"line_number":851,"context_line":"                self._cleanup_when_reschedule_fails(context, instance, exc,"},{"line_number":852,"context_line":"                     legacy_request_spec, requested_networks)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f493fa4_0e8fa023","line":849,"range":{"start_line":848,"start_character":20,"end_line":849,"end_character":59},"in_reply_to":"1f493fa4_7eac248c","updated":"2020-04-23 00:09:16.000000000","message":"\u003e im not really sure we shoudl have\n \u003e compute_utils.delete_arqs_if_needed() to be honest.\n \u003e i dont think that belongs in compute_utils and shoudl instead be in\n \u003e the cyborg nova.acclerator.cyborg module\n \u003e \n \u003e if its going to be used in both the comptue and the conductor the\n \u003e compute utils module is not the correct place to put the function.\n \u003e \n \u003e i can remove the leading _\n\nI think, there will be many places in the future that need to use this cleanup method, it is friendly to encapsulate a public method, of course, this is just my thought.","commit_id":"75e31333629180e37a539b6ae4c778137236348f"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"76733932d65aa2c60bd1dcc41f3d4be12088cc9f","unresolved":false,"context_lines":[{"line_number":845,"context_line":"                    host.nodename, resource_provider_mapping)"},{"line_number":846,"context_line":"            except Exception as exc:"},{"line_number":847,"context_line":"                if isinstance(exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":848,"context_line":"                    cyclient \u003d cyborg.get_client(context)"},{"line_number":849,"context_line":"                    cyclient._delete_arqs_by_uuid(exc.arqs)"},{"line_number":850,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027, exc)"},{"line_number":851,"context_line":"                self._cleanup_when_reschedule_fails(context, instance, exc,"},{"line_number":852,"context_line":"                     legacy_request_spec, requested_networks)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f493fa4_7eac248c","line":849,"range":{"start_line":848,"start_character":20,"end_line":849,"end_character":59},"in_reply_to":"1f493fa4_ce35cff9","updated":"2020-04-22 12:07:47.000000000","message":"im not really sure we shoudl have \ncompute_utils.delete_arqs_if_needed() to be honest.\ni dont think that belongs in compute_utils and shoudl instead be in the cyborg nova.acclerator.cyborg module\n\nif its going to be used in both the comptue and the conductor the compute utils module is not the correct place to put the function.\n\ni can remove the leading _","commit_id":"75e31333629180e37a539b6ae4c778137236348f"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"461d7d34b1d7fb1aa7eeb4af04e7fb9b03a1f89f","unresolved":false,"context_lines":[{"line_number":1636,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1637,"context_line":"                    if isinstance("},{"line_number":1638,"context_line":"                            exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":1639,"context_line":"                        cyclient \u003d cyborg.get_client(context)"},{"line_number":1640,"context_line":"                        cyclient._delete_arqs_by_uuid(exc.arqs)"},{"line_number":1641,"context_line":"                    self._cleanup_build_artifacts("},{"line_number":1642,"context_line":"                        context, exc, instances, build_requests, request_specs,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f493fa4_b94a4b52","line":1639,"updated":"2020-04-22 08:04:26.000000000","message":"Seems you missed test case to cover this exception","commit_id":"75e31333629180e37a539b6ae4c778137236348f"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"76733932d65aa2c60bd1dcc41f3d4be12088cc9f","unresolved":false,"context_lines":[{"line_number":1636,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1637,"context_line":"                    if isinstance("},{"line_number":1638,"context_line":"                            exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":1639,"context_line":"                        cyclient \u003d cyborg.get_client(context)"},{"line_number":1640,"context_line":"                        cyclient._delete_arqs_by_uuid(exc.arqs)"},{"line_number":1641,"context_line":"                    self._cleanup_build_artifacts("},{"line_number":1642,"context_line":"                        context, exc, instances, build_requests, request_specs,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f493fa4_1e69a024","line":1639,"in_reply_to":"1f493fa4_b94a4b52","updated":"2020-04-22 12:07:47.000000000","message":"this should be covered by https://review.opendev.org/#/c/716186/9/nova/tests/unit/conductor/test_conductor.py\n\ni could modify that test case to assert that the arq delete happens i guess but i modifed it raise the new exception.","commit_id":"75e31333629180e37a539b6ae4c778137236348f"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"461d7d34b1d7fb1aa7eeb4af04e7fb9b03a1f89f","unresolved":false,"context_lines":[{"line_number":1636,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1637,"context_line":"                    if isinstance("},{"line_number":1638,"context_line":"                            exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":1639,"context_line":"                        cyclient \u003d cyborg.get_client(context)"},{"line_number":1640,"context_line":"                        cyclient._delete_arqs_by_uuid(exc.arqs)"},{"line_number":1641,"context_line":"                    self._cleanup_build_artifacts("},{"line_number":1642,"context_line":"                        context, exc, instances, build_requests, request_specs,"},{"line_number":1643,"context_line":"                        block_device_mapping, tags, cell_mapping_cache)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f493fa4_0e405756","line":1640,"range":{"start_line":1639,"start_character":24,"end_line":1640,"end_character":63},"updated":"2020-04-22 08:04:26.000000000","message":"ditto.","commit_id":"75e31333629180e37a539b6ae4c778137236348f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"4a7b07cbf76afffb2999a0076e60e22102e073e6","unresolved":false,"context_lines":[{"line_number":857,"context_line":"                    limits\u003dhost.limits, host_list\u003dhost_list,"},{"line_number":858,"context_line":"                    accel_uuids\u003daccel_uuids)"},{"line_number":859,"context_line":""},{"line_number":860,"context_line":"    def _get_resource_mappings_and_uuids_build_instances("},{"line_number":861,"context_line":"            self, context, instance, host, legacy_request_spec,"},{"line_number":862,"context_line":"                requested_networks, local_reqspec):"},{"line_number":863,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":13,"id":"bf51134e_1420709b","line":860,"range":{"start_line":860,"start_character":8,"end_line":860,"end_character":56},"updated":"2020-07-20 10:14:22.000000000","message":"The resource mapping gathered only to be passed to _create_and_bind_arqs so the caller of this function does not need to know about it. Therefor this can be renamed to _create_and_bind_arqs()","commit_id":"5d38c0fc0a72d8e3d0bcd62a2502adec90ceece7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"fe6d868d4cec9f667119a0c309f18e4bae8dbf28","unresolved":false,"context_lines":[{"line_number":857,"context_line":"                    limits\u003dhost.limits, host_list\u003dhost_list,"},{"line_number":858,"context_line":"                    accel_uuids\u003daccel_uuids)"},{"line_number":859,"context_line":""},{"line_number":860,"context_line":"    def _get_resource_mappings_and_uuids_build_instances("},{"line_number":861,"context_line":"            self, context, instance, host, legacy_request_spec,"},{"line_number":862,"context_line":"                requested_networks, local_reqspec):"},{"line_number":863,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":13,"id":"bf51134e_4a107850","line":860,"range":{"start_line":860,"start_character":8,"end_line":860,"end_character":56},"in_reply_to":"bf51134e_1420709b","updated":"2020-07-21 02:06:48.000000000","message":"Done","commit_id":"5d38c0fc0a72d8e3d0bcd62a2502adec90ceece7"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"749d8816b9ec1f2d6a416e334b4413d023392869","unresolved":false,"context_lines":[{"line_number":866,"context_line":"            return self._create_and_bind_arqs("},{"line_number":867,"context_line":"                context, instance.uuid, instance.flavor.extra_specs,"},{"line_number":868,"context_line":"                host.nodename, resource_provider_mapping)"},{"line_number":869,"context_line":"        except Exception as exc:"},{"line_number":870,"context_line":"            if isinstance(exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":871,"context_line":"                cyclient \u003d cyborg.get_client(context)"},{"line_number":872,"context_line":"                cyclient.delete_arqs_by_uuid(exc.arqs)"}],"source_content_type":"text/x-python","patch_set":13,"id":"bf51134e_548668bc","line":869,"range":{"start_line":869,"start_character":15,"end_line":869,"end_character":24},"updated":"2020-07-20 10:56:12.000000000","message":"so gibi means make this exception.AcceleratorRequestBindingFailed\nwhich allows you to remove the if below and just do \n\ncyclient \u003d cyborg.get_client(context)\ncyclient.delete_arqs_by_uuid(exc.arqs)\n\n\nand then you can move  \n\nself._cleanup_when_reschedule_fails(\ncontext, instance, exc, legacy_request_spec,\nrequested_networks)\n\nto line 846 above","commit_id":"5d38c0fc0a72d8e3d0bcd62a2502adec90ceece7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"fe6d868d4cec9f667119a0c309f18e4bae8dbf28","unresolved":false,"context_lines":[{"line_number":866,"context_line":"            return self._create_and_bind_arqs("},{"line_number":867,"context_line":"                context, instance.uuid, instance.flavor.extra_specs,"},{"line_number":868,"context_line":"                host.nodename, resource_provider_mapping)"},{"line_number":869,"context_line":"        except Exception as exc:"},{"line_number":870,"context_line":"            if isinstance(exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":871,"context_line":"                cyclient \u003d cyborg.get_client(context)"},{"line_number":872,"context_line":"                cyclient.delete_arqs_by_uuid(exc.arqs)"}],"source_content_type":"text/x-python","patch_set":13,"id":"bf51134e_0a332064","line":869,"range":{"start_line":869,"start_character":15,"end_line":869,"end_character":24},"in_reply_to":"bf51134e_548668bc","updated":"2020-07-21 02:06:48.000000000","message":"Done","commit_id":"5d38c0fc0a72d8e3d0bcd62a2502adec90ceece7"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"4a7b07cbf76afffb2999a0076e60e22102e073e6","unresolved":false,"context_lines":[{"line_number":867,"context_line":"                context, instance.uuid, instance.flavor.extra_specs,"},{"line_number":868,"context_line":"                host.nodename, resource_provider_mapping)"},{"line_number":869,"context_line":"        except Exception as exc:"},{"line_number":870,"context_line":"            if isinstance(exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":871,"context_line":"                cyclient \u003d cyborg.get_client(context)"},{"line_number":872,"context_line":"                cyclient.delete_arqs_by_uuid(exc.arqs)"},{"line_number":873,"context_line":"            LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027, exc)"}],"source_content_type":"text/x-python","patch_set":13,"id":"bf51134e_14f19002","line":870,"updated":"2020-07-20 10:14:22.000000000","message":"this is ugly. I would do the following.\n\nI let this function handle the AcceleratorRequestBindingFailed exception directly in an except block by deleting arqs, then rerease the exception. Then keep the generic cleanup in the caller\u0027s except Exception block, so the cleanup would happen in every case.","commit_id":"5d38c0fc0a72d8e3d0bcd62a2502adec90ceece7"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"4a7b07cbf76afffb2999a0076e60e22102e073e6","unresolved":false,"context_lines":[{"line_number":1659,"context_line":"                    limits\u003dhost.limits, host_list\u003dhost_list,"},{"line_number":1660,"context_line":"                    accel_uuids\u003daccel_uuids)"},{"line_number":1661,"context_line":""},{"line_number":1662,"context_line":"    def _get_resource_mappings_schedule_and_build("},{"line_number":1663,"context_line":"            self, request_spec, instance, context, instances, build_requests,"},{"line_number":1664,"context_line":"            request_specs, block_device_mapping, tags, cell_mapping_cache,"},{"line_number":1665,"context_line":"            host):"}],"source_content_type":"text/x-python","patch_set":13,"id":"bf51134e_543e68b9","line":1662,"range":{"start_line":1662,"start_character":8,"end_line":1662,"end_character":49},"updated":"2020-07-20 10:14:22.000000000","message":"ditto. The naming of the function should only talk about the goal of the function which is creating and binding arqs, and not about the internal steps it takes to get there.","commit_id":"5d38c0fc0a72d8e3d0bcd62a2502adec90ceece7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"fe6d868d4cec9f667119a0c309f18e4bae8dbf28","unresolved":false,"context_lines":[{"line_number":1659,"context_line":"                    limits\u003dhost.limits, host_list\u003dhost_list,"},{"line_number":1660,"context_line":"                    accel_uuids\u003daccel_uuids)"},{"line_number":1661,"context_line":""},{"line_number":1662,"context_line":"    def _get_resource_mappings_schedule_and_build("},{"line_number":1663,"context_line":"            self, request_spec, instance, context, instances, build_requests,"},{"line_number":1664,"context_line":"            request_specs, block_device_mapping, tags, cell_mapping_cache,"},{"line_number":1665,"context_line":"            host):"}],"source_content_type":"text/x-python","patch_set":13,"id":"bf51134e_2a39c43e","line":1662,"range":{"start_line":1662,"start_character":8,"end_line":1662,"end_character":49},"in_reply_to":"bf51134e_543e68b9","updated":"2020-07-21 02:06:48.000000000","message":"Yeah, we can merge these two functions.","commit_id":"5d38c0fc0a72d8e3d0bcd62a2502adec90ceece7"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"4a7b07cbf76afffb2999a0076e60e22102e073e6","unresolved":false,"context_lines":[{"line_number":1672,"context_line":"            return self._create_and_bind_arqs("},{"line_number":1673,"context_line":"                context, instance.uuid, instance.flavor.extra_specs,"},{"line_number":1674,"context_line":"                host.nodename, resource_provider_mapping)"},{"line_number":1675,"context_line":"        except Exception as exc:"},{"line_number":1676,"context_line":"            # If anything failed here we need to cleanup and bail out."},{"line_number":1677,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":1678,"context_line":"                if isinstance("},{"line_number":1679,"context_line":"                        exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":1680,"context_line":"                    cyclient \u003d cyborg.get_client(context)"},{"line_number":1681,"context_line":"                    cyclient.delete_arqs_by_uuid(exc.arqs)"},{"line_number":1682,"context_line":"                    self._cleanup_build_artifacts("}],"source_content_type":"text/x-python","patch_set":13,"id":"bf51134e_744f2c34","line":1679,"range":{"start_line":1675,"start_character":0,"end_line":1679,"end_character":72},"updated":"2020-07-20 10:14:22.000000000","message":"similarly I would let the generic cleanup happen in the caller as in the baseline and do the AcceleratorRequestBindingFailed specific cleanup here in a dedicated except block","commit_id":"5d38c0fc0a72d8e3d0bcd62a2502adec90ceece7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"fe6d868d4cec9f667119a0c309f18e4bae8dbf28","unresolved":false,"context_lines":[{"line_number":1672,"context_line":"            return self._create_and_bind_arqs("},{"line_number":1673,"context_line":"                context, instance.uuid, instance.flavor.extra_specs,"},{"line_number":1674,"context_line":"                host.nodename, resource_provider_mapping)"},{"line_number":1675,"context_line":"        except Exception as exc:"},{"line_number":1676,"context_line":"            # If anything failed here we need to cleanup and bail out."},{"line_number":1677,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":1678,"context_line":"                if isinstance("},{"line_number":1679,"context_line":"                        exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":1680,"context_line":"                    cyclient \u003d cyborg.get_client(context)"},{"line_number":1681,"context_line":"                    cyclient.delete_arqs_by_uuid(exc.arqs)"},{"line_number":1682,"context_line":"                    self._cleanup_build_artifacts("}],"source_content_type":"text/x-python","patch_set":13,"id":"bf51134e_6a43bcb0","line":1679,"range":{"start_line":1675,"start_character":0,"end_line":1679,"end_character":72},"in_reply_to":"bf51134e_744f2c34","updated":"2020-07-21 02:06:48.000000000","message":"it\u0027s will be better.","commit_id":"5d38c0fc0a72d8e3d0bcd62a2502adec90ceece7"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"858f1753a020c9a00f901c1e8e52d62c76610baf","unresolved":false,"context_lines":[{"line_number":873,"context_line":"            # If anything failed here we need to cleanup and bail out."},{"line_number":874,"context_line":"            cyclient \u003d cyborg.get_client(context)"},{"line_number":875,"context_line":"            cyclient.delete_arqs_by_uuid(exc.arqs)"},{"line_number":876,"context_line":"            raise exc"},{"line_number":877,"context_line":""},{"line_number":878,"context_line":"    def _schedule_instances(self, context, request_spec,"},{"line_number":879,"context_line":"                            instance_uuids\u003dNone, return_alternates\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":15,"id":"bf51134e_ba5b49f4","line":876,"range":{"start_line":876,"start_character":12,"end_line":876,"end_character":21},"updated":"2020-07-22 08:04:14.000000000","message":"you can simply say \u0027raise\u0027 that will re-raise the exception that is being handled.","commit_id":"38b7854ea8b3a5304ffbd6162d60acb5b9d8f62c"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"29e75c4e5a8ed4804d1e21b335aec88f0df160af","unresolved":false,"context_lines":[{"line_number":873,"context_line":"            # If anything failed here we need to cleanup and bail out."},{"line_number":874,"context_line":"            cyclient \u003d cyborg.get_client(context)"},{"line_number":875,"context_line":"            cyclient.delete_arqs_by_uuid(exc.arqs)"},{"line_number":876,"context_line":"            raise exc"},{"line_number":877,"context_line":""},{"line_number":878,"context_line":"    def _schedule_instances(self, context, request_spec,"},{"line_number":879,"context_line":"                            instance_uuids\u003dNone, return_alternates\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":15,"id":"bf51134e_02011205","line":876,"range":{"start_line":876,"start_character":12,"end_line":876,"end_character":21},"in_reply_to":"bf51134e_ba5b49f4","updated":"2020-07-23 07:00:06.000000000","message":"Done","commit_id":"38b7854ea8b3a5304ffbd6162d60acb5b9d8f62c"}],"nova/exception.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"4a7b07cbf76afffb2999a0076e60e22102e073e6","unresolved":false,"context_lines":[{"line_number":2320,"context_line":"class AcceleratorRequestBindingFailed(NovaException):"},{"line_number":2321,"context_line":"    msg_fmt \u003d _(\"Failed to bind accelerator requests: %(msg)s\")"},{"line_number":2322,"context_line":""},{"line_number":2323,"context_line":"    def __init__(self, message\u003dNone, arqs\u003dNone, **kwargs):"},{"line_number":2324,"context_line":"        super().__init__(message\u003dmessage, **kwargs)"},{"line_number":2325,"context_line":"        self.arqs \u003d arqs or []"},{"line_number":2326,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"bf51134e_54f668da","line":2323,"range":{"start_line":2323,"start_character":23,"end_line":2323,"end_character":46},"updated":"2020-07-20 10:14:22.000000000","message":"you always pass such parameters to the exception so you don\u0027t need default value for them","commit_id":"5d38c0fc0a72d8e3d0bcd62a2502adec90ceece7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"fe6d868d4cec9f667119a0c309f18e4bae8dbf28","unresolved":false,"context_lines":[{"line_number":2320,"context_line":"class AcceleratorRequestBindingFailed(NovaException):"},{"line_number":2321,"context_line":"    msg_fmt \u003d _(\"Failed to bind accelerator requests: %(msg)s\")"},{"line_number":2322,"context_line":""},{"line_number":2323,"context_line":"    def __init__(self, message\u003dNone, arqs\u003dNone, **kwargs):"},{"line_number":2324,"context_line":"        super().__init__(message\u003dmessage, **kwargs)"},{"line_number":2325,"context_line":"        self.arqs \u003d arqs or []"},{"line_number":2326,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"bf51134e_cf601a11","line":2323,"range":{"start_line":2323,"start_character":23,"end_line":2323,"end_character":46},"in_reply_to":"bf51134e_54f668da","updated":"2020-07-21 02:06:48.000000000","message":"Done","commit_id":"5d38c0fc0a72d8e3d0bcd62a2502adec90ceece7"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"858f1753a020c9a00f901c1e8e52d62c76610baf","unresolved":false,"context_lines":[{"line_number":2319,"context_line":"class AcceleratorRequestBindingFailed(NovaException):"},{"line_number":2320,"context_line":"    msg_fmt \u003d _(\"Failed to bind accelerator requests: %(msg)s\")"},{"line_number":2321,"context_line":""},{"line_number":2322,"context_line":"    def __init__(self, message, arqs\u003dNone, **kwargs):"},{"line_number":2323,"context_line":"        super().__init__(message\u003dmessage, **kwargs)"},{"line_number":2324,"context_line":"        self.arqs \u003d arqs or []"},{"line_number":2325,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"bf51134e_ba7fc964","line":2322,"range":{"start_line":2322,"start_character":23,"end_line":2322,"end_character":30},"updated":"2020-07-22 08:04:14.000000000","message":"You don\u0027t need the message parameter at all. \n\nYou defined msg_fmt above. That will be the message of the exception. You need to pass msg as a kwargs to extend msg_fmt.","commit_id":"38b7854ea8b3a5304ffbd6162d60acb5b9d8f62c"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"858f1753a020c9a00f901c1e8e52d62c76610baf","unresolved":false,"context_lines":[{"line_number":2319,"context_line":"class AcceleratorRequestBindingFailed(NovaException):"},{"line_number":2320,"context_line":"    msg_fmt \u003d _(\"Failed to bind accelerator requests: %(msg)s\")"},{"line_number":2321,"context_line":""},{"line_number":2322,"context_line":"    def __init__(self, message, arqs\u003dNone, **kwargs):"},{"line_number":2323,"context_line":"        super().__init__(message\u003dmessage, **kwargs)"},{"line_number":2324,"context_line":"        self.arqs \u003d arqs or []"},{"line_number":2325,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"bf51134e_daa39dff","line":2322,"range":{"start_line":2322,"start_character":32,"end_line":2322,"end_character":41},"updated":"2020-07-22 08:04:14.000000000","message":"arqs is always passed, you don\u0027t need to default it.","commit_id":"38b7854ea8b3a5304ffbd6162d60acb5b9d8f62c"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"29e75c4e5a8ed4804d1e21b335aec88f0df160af","unresolved":false,"context_lines":[{"line_number":2319,"context_line":"class AcceleratorRequestBindingFailed(NovaException):"},{"line_number":2320,"context_line":"    msg_fmt \u003d _(\"Failed to bind accelerator requests: %(msg)s\")"},{"line_number":2321,"context_line":""},{"line_number":2322,"context_line":"    def __init__(self, message, arqs\u003dNone, **kwargs):"},{"line_number":2323,"context_line":"        super().__init__(message\u003dmessage, **kwargs)"},{"line_number":2324,"context_line":"        self.arqs \u003d arqs or []"},{"line_number":2325,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"bf51134e_6208ce27","line":2322,"range":{"start_line":2322,"start_character":23,"end_line":2322,"end_character":30},"in_reply_to":"bf51134e_ba7fc964","updated":"2020-07-23 07:00:06.000000000","message":"Done","commit_id":"38b7854ea8b3a5304ffbd6162d60acb5b9d8f62c"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"29e75c4e5a8ed4804d1e21b335aec88f0df160af","unresolved":false,"context_lines":[{"line_number":2319,"context_line":"class AcceleratorRequestBindingFailed(NovaException):"},{"line_number":2320,"context_line":"    msg_fmt \u003d _(\"Failed to bind accelerator requests: %(msg)s\")"},{"line_number":2321,"context_line":""},{"line_number":2322,"context_line":"    def __init__(self, message, arqs\u003dNone, **kwargs):"},{"line_number":2323,"context_line":"        super().__init__(message\u003dmessage, **kwargs)"},{"line_number":2324,"context_line":"        self.arqs \u003d arqs or []"},{"line_number":2325,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"bf51134e_420b0a23","line":2322,"range":{"start_line":2322,"start_character":32,"end_line":2322,"end_character":41},"in_reply_to":"bf51134e_daa39dff","updated":"2020-07-23 07:00:06.000000000","message":"Done","commit_id":"38b7854ea8b3a5304ffbd6162d60acb5b9d8f62c"}]}
