)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"8f8c5e7c7012b9d2131aefc5a66e7405513d00ac","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2019-02-06 21:59:51 -0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"WIP: Create and bind Cyborg ARQs."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: I0f8b6bf2b4f4510da6c84fede532533602b6af7f"},{"line_number":10,"context_line":"Blueprint: nova-cyborg-interaction"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"9fdfeff1_725412cb","line":8,"updated":"2019-02-09 00:12:03.000000000","message":"Again words here. Something like:\n\nThe conductor determines whether cyborg-managed accelerator resources were requested on the instance. If so, it creates Cyborg ARQs (Accelerator ReQuests) and binds them to the destination host and instance. This binding step causes Cyborg to (asynchronously) start selecting real accelerators based on the resources in the allocation. In the future this step will also cause Cyborg to start preparing the devices for use by the instance (e.g. programming them).","commit_id":"369cf0f2a4d890f341d72d06be451cecdee04ea4"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"a1d5154698a2e953c864d73932105a289c982d02","unresolved":false,"context_lines":[{"line_number":18,"context_line":"Contributions from Li Liu for notification events."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Depends-On: https://review.opendev.org/#/c/698846"},{"line_number":21,"context_line":"Depends-On: https://review.opendev.org/#/c/700261"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Change-Id: I0f8b6bf2b4f4510da6c84fede532533602b6af7f"},{"line_number":24,"context_line":"Blueprint: nova-cyborg-interaction"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":54,"id":"3fa7e38b_f71f8357","line":21,"updated":"2020-01-18 16:40:45.000000000","message":"Remove this 2nd dependency.","commit_id":"ecf94f0e8431d8e1b6c04cd66fa13ad53212f0c3"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"a881a60fe2d8f71748785270b163f8125847c1a1","unresolved":false,"context_lines":[{"line_number":18,"context_line":"Contributions from Li Liu for notification events."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Depends-On: https://review.opendev.org/#/c/698846"},{"line_number":21,"context_line":"Depends-On: https://review.opendev.org/#/c/700261"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Change-Id: I0f8b6bf2b4f4510da6c84fede532533602b6af7f"},{"line_number":24,"context_line":"Blueprint: nova-cyborg-interaction"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":54,"id":"3fa7e38b_d7fa6e0f","line":21,"in_reply_to":"3fa7e38b_f71f8357","updated":"2020-01-26 01:11:27.000000000","message":"Done","commit_id":"ecf94f0e8431d8e1b6c04cd66fa13ad53212f0c3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"618a11eddb87ba9bc20084387236cdb302e4091f","unresolved":false,"context_lines":[{"line_number":14,"context_line":"Call Cyborg to bind the ARQ to that host/device-RP."},{"line_number":15,"context_line":"When Cyborg sends the ARQ bind notification events, wait for those"},{"line_number":16,"context_line":"   events with a timeout."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Contributions from Li Liu for notification events."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Depends-On: https://review.opendev.org/#/c/698846"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":61,"id":"3fa7e38b_5de1bffc","line":17,"updated":"2020-02-07 17:17:34.000000000","message":"nit: There are some strange formatting in this message","commit_id":"234a66647303f08253eb7adb0c6696ac43bccb2a"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"940016f36ef01fd317ca3bf4a2b2775fa5ccd67c","unresolved":false,"context_lines":[{"line_number":14,"context_line":"Call Cyborg to bind the ARQ to that host/device-RP."},{"line_number":15,"context_line":"When Cyborg sends the ARQ bind notification events, wait for those"},{"line_number":16,"context_line":"   events with a timeout."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Contributions from Li Liu for notification events."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Depends-On: https://review.opendev.org/#/c/698846"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":61,"id":"3fa7e38b_4541dd36","line":17,"in_reply_to":"3fa7e38b_5de1bffc","updated":"2020-02-13 00:03:44.000000000","message":"Done","commit_id":"234a66647303f08253eb7adb0c6696ac43bccb2a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"618a11eddb87ba9bc20084387236cdb302e4091f","unresolved":false,"context_lines":[{"line_number":15,"context_line":"When Cyborg sends the ARQ bind notification events, wait for those"},{"line_number":16,"context_line":"   events with a timeout."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Contributions from Li Liu for notification events."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Depends-On: https://review.opendev.org/#/c/698846"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":61,"id":"3fa7e38b_bdb1d302","line":18,"updated":"2020-02-07 17:17:34.000000000","message":"The official tag would be Co-Authored-By: name \u003cname@example.com\u003e","commit_id":"234a66647303f08253eb7adb0c6696ac43bccb2a"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"940016f36ef01fd317ca3bf4a2b2775fa5ccd67c","unresolved":false,"context_lines":[{"line_number":15,"context_line":"When Cyborg sends the ARQ bind notification events, wait for those"},{"line_number":16,"context_line":"   events with a timeout."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Contributions from Li Liu for notification events."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Depends-On: https://review.opendev.org/#/c/698846"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":61,"id":"3fa7e38b_0571a5ab","line":18,"in_reply_to":"3fa7e38b_bdb1d302","updated":"2020-02-13 00:03:44.000000000","message":"This is not a co-authored patch. There was another patch on notification events, which has since been abandoned, and I was acknowledging its author for starting this effort.","commit_id":"234a66647303f08253eb7adb0c6696ac43bccb2a"}],"nova/accelerator/cyborg.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0bf3028451ebc67bff2d1412f600e96f532a5273","unresolved":false,"context_lines":[{"line_number":93,"context_line":"                                required_traits, forbidden_traits))"},{"line_number":94,"context_line":"        return nova_groups"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def create_arqs(self, dp_name):"},{"line_number":97,"context_line":"        if dp_name is None:"},{"line_number":98,"context_line":"            return None"},{"line_number":99,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_f1bcc46d","line":96,"range":{"start_line":96,"start_character":8,"end_line":96,"end_character":19},"updated":"2019-02-08 23:55:13.000000000","message":"docstring please","commit_id":"fbb744eaf2815e19b73aca457f8793a49d27319b"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0bf3028451ebc67bff2d1412f600e96f532a5273","unresolved":false,"context_lines":[{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def create_arqs(self, dp_name):"},{"line_number":97,"context_line":"        if dp_name is None:"},{"line_number":98,"context_line":"            return None"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        url \u003d \"/arqs\""},{"line_number":101,"context_line":"        data \u003d {\"device_profile_name\": dp_name}"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_d1ed008c","line":98,"range":{"start_line":98,"start_character":12,"end_line":98,"end_character":23},"updated":"2019-02-08 23:55:13.000000000","message":"Eventually an error","commit_id":"fbb744eaf2815e19b73aca457f8793a49d27319b"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0bf3028451ebc67bff2d1412f600e96f532a5273","unresolved":false,"context_lines":[{"line_number":105,"context_line":"        LOG.warning(\u0027NSS arq ret %s\u0027, r)"},{"line_number":106,"context_line":"        return r.json()"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def bind_arqs(self, bindings):"},{"line_number":109,"context_line":"        if bindings is None:"},{"line_number":110,"context_line":"            return"},{"line_number":111,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_918458b3","line":108,"range":{"start_line":108,"start_character":24,"end_line":108,"end_character":32},"updated":"2019-02-08 23:55:13.000000000","message":"What is a `bindings`? Docstring please (even/especially for the PoC).","commit_id":"fbb744eaf2815e19b73aca457f8793a49d27319b"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0bf3028451ebc67bff2d1412f600e96f532a5273","unresolved":false,"context_lines":[{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def bind_arqs(self, bindings):"},{"line_number":109,"context_line":"        if bindings is None:"},{"line_number":110,"context_line":"            return"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        url \u003d \"/arqs/bindings\""},{"line_number":113,"context_line":"        data \u003d {\"bindings\": bindings}"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_1199481e","line":110,"range":{"start_line":110,"start_character":12,"end_line":110,"end_character":18},"updated":"2019-02-08 23:55:13.000000000","message":"eventually an error","commit_id":"fbb744eaf2815e19b73aca457f8793a49d27319b"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"772d3ce1b474f49c23b9e29f78c10533423fb2ca","unresolved":false,"context_lines":[{"line_number":103,"context_line":"        data \u003d {\"device_profile_name\": dp_name}"},{"line_number":104,"context_line":"        r \u003d self._client.post(url, json\u003ddata)"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        LOG.warning(\u0027NSS arq ret code %s\u0027, r.status_code)"},{"line_number":107,"context_line":"        LOG.warning(\u0027NSS arq ret %s\u0027, r)"},{"line_number":108,"context_line":"        return r.json()"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def bind_arqs(self, bindings):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_08521b3c","line":107,"range":{"start_line":106,"start_character":21,"end_line":107,"end_character":36},"updated":"2019-02-12 02:09:07.000000000","message":"I\u0027d say, this kind of log is really hard to read..","commit_id":"369cf0f2a4d890f341d72d06be451cecdee04ea4"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a292ee4a44f16382198996abd5103c7fcf65d11b","unresolved":false,"context_lines":[{"line_number":103,"context_line":"        data \u003d {\"device_profile_name\": dp_name}"},{"line_number":104,"context_line":"        r \u003d self._client.post(url, json\u003ddata)"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        LOG.warning(\u0027NSS arq ret code %s\u0027, r.status_code)"},{"line_number":107,"context_line":"        LOG.warning(\u0027NSS arq ret %s\u0027, r)"},{"line_number":108,"context_line":"        return r.json()"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def bind_arqs(self, bindings):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_9225cdc4","line":107,"range":{"start_line":106,"start_character":21,"end_line":107,"end_character":36},"in_reply_to":"9fdfeff1_08521b3c","updated":"2019-02-12 14:12:39.000000000","message":"This is just debug logging for development, will be removed by prod time.","commit_id":"369cf0f2a4d890f341d72d06be451cecdee04ea4"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"1a8b85aa8cf570b6fb094f7d92003109e60b1a87","unresolved":false,"context_lines":[{"line_number":103,"context_line":"        data \u003d {\"device_profile_name\": dp_name}"},{"line_number":104,"context_line":"        r \u003d self._client.post(url, json\u003ddata)"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        LOG.warning(\u0027NSS arq ret code %s\u0027, r.status_code)"},{"line_number":107,"context_line":"        LOG.warning(\u0027NSS arq ret %s\u0027, r)"},{"line_number":108,"context_line":"        return r.json()"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def bind_arqs(self, bindings):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_4e04d97e","line":107,"range":{"start_line":106,"start_character":21,"end_line":107,"end_character":36},"in_reply_to":"9fdfeff1_9225cdc4","updated":"2019-02-22 00:40:53.000000000","message":"Yes indeed. I\u0027ll try not to commit them in the future.","commit_id":"369cf0f2a4d890f341d72d06be451cecdee04ea4"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0bf3028451ebc67bff2d1412f600e96f532a5273","unresolved":false,"context_lines":[{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        url \u003d \"/arqs/bindings\""},{"line_number":115,"context_line":"        data \u003d {\"bindings\": bindings}"},{"line_number":116,"context_line":"        self._client.post(url, json\u003ddata)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_17e018fa","line":116,"updated":"2019-02-08 23:55:13.000000000","message":"error checking, here and above.\n\n(in particular, iirc ksa adapters are now set up by default *not* to raise exceptions on 4xx/5xx status codes)","commit_id":"369cf0f2a4d890f341d72d06be451cecdee04ea4"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"1a8b85aa8cf570b6fb094f7d92003109e60b1a87","unresolved":false,"context_lines":[{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        url \u003d \"/arqs/bindings\""},{"line_number":115,"context_line":"        data \u003d {\"bindings\": bindings}"},{"line_number":116,"context_line":"        self._client.post(url, json\u003ddata)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_ae8b05be","line":116,"in_reply_to":"9fdfeff1_17e018fa","updated":"2019-02-22 00:40:53.000000000","message":"Done","commit_id":"369cf0f2a4d890f341d72d06be451cecdee04ea4"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"8c0eea4d7d31609ac7ef6d758ac709e67e587c20","unresolved":false,"context_lines":[{"line_number":130,"context_line":"                get_device_profile_group_requester_id(dp_group_id))"},{"line_number":131,"context_line":"            for rg in req_groups:"},{"line_number":132,"context_line":"                if rg.requester_id \u003d\u003d dp_group_requester_id:"},{"line_number":133,"context_line":"                    assert len(rg.provider_uuids) \u003d\u003d 1"},{"line_number":134,"context_line":"                    arq[\u0027device_rp_uuid\u0027] \u003d rg.provider_uuids[0]"},{"line_number":135,"context_line":"            assert arq[\u0027device_rp_uuid\u0027] is not None"},{"line_number":136,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"7faddb67_d59e3106","line":133,"updated":"2019-07-08 15:53:56.000000000","message":"Unless you\u0027re going to catch AssertionError somewhere close by, these should be checks that raise a NovaException-based exception with a meaningful message.","commit_id":"615b2d2f66332f38ac1530522a450ef546b10467"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"446bddc57728e9b97617db7a1ab73c06889479b6","unresolved":false,"context_lines":[{"line_number":130,"context_line":"                get_device_profile_group_requester_id(dp_group_id))"},{"line_number":131,"context_line":"            for rg in req_groups:"},{"line_number":132,"context_line":"                if rg.requester_id \u003d\u003d dp_group_requester_id:"},{"line_number":133,"context_line":"                    assert len(rg.provider_uuids) \u003d\u003d 1"},{"line_number":134,"context_line":"                    arq[\u0027device_rp_uuid\u0027] \u003d rg.provider_uuids[0]"},{"line_number":135,"context_line":"            assert arq[\u0027device_rp_uuid\u0027] is not None"},{"line_number":136,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"7faddb67_cd53af6a","line":133,"in_reply_to":"7faddb67_d59e3106","updated":"2019-07-31 05:22:28.000000000","message":"Done","commit_id":"615b2d2f66332f38ac1530522a450ef546b10467"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"8c0eea4d7d31609ac7ef6d758ac709e67e587c20","unresolved":false,"context_lines":[{"line_number":152,"context_line":"                }"},{"line_number":153,"context_line":"           :returns: nothing"},{"line_number":154,"context_line":"        \"\"\""},{"line_number":155,"context_line":"        LOG.info(\u0027DEMO: Binding ARQs. bindings \u003d %s\u0027, bindings)"},{"line_number":156,"context_line":"        # Create a JSON patch in RFC 6902 format"},{"line_number":157,"context_line":"        patch_list \u003d {}"},{"line_number":158,"context_line":"        for arq_uuid, binding in bindings.items():"}],"source_content_type":"text/x-python","patch_set":19,"id":"7faddb67_55e481ac","line":155,"range":{"start_line":155,"start_character":18,"end_line":155,"end_character":22},"updated":"2019-07-08 15:53:56.000000000","message":"Assume these DEMO items are leftover debug and should be removed...","commit_id":"615b2d2f66332f38ac1530522a450ef546b10467"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"446bddc57728e9b97617db7a1ab73c06889479b6","unresolved":false,"context_lines":[{"line_number":152,"context_line":"                }"},{"line_number":153,"context_line":"           :returns: nothing"},{"line_number":154,"context_line":"        \"\"\""},{"line_number":155,"context_line":"        LOG.info(\u0027DEMO: Binding ARQs. bindings \u003d %s\u0027, bindings)"},{"line_number":156,"context_line":"        # Create a JSON patch in RFC 6902 format"},{"line_number":157,"context_line":"        patch_list \u003d {}"},{"line_number":158,"context_line":"        for arq_uuid, binding in bindings.items():"}],"source_content_type":"text/x-python","patch_set":19,"id":"7faddb67_6d4cfbc7","line":155,"range":{"start_line":155,"start_character":18,"end_line":155,"end_character":22},"in_reply_to":"7faddb67_55e481ac","updated":"2019-07-31 05:22:28.000000000","message":"Done","commit_id":"615b2d2f66332f38ac1530522a450ef546b10467"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"8c0eea4d7d31609ac7ef6d758ac709e67e587c20","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        url \u003d self.ARQ_URL"},{"line_number":166,"context_line":"        r \u003d self._client.patch(url, json\u003dpatch_list)"},{"line_number":167,"context_line":"        if not r:"},{"line_number":168,"context_line":"            raise RuntimeError(\u0027Failed to bind Cyborg accelerator requests\u0027)"}],"source_content_type":"text/x-python","patch_set":19,"id":"7faddb67_d5d071cc","line":168,"range":{"start_line":168,"start_character":18,"end_line":168,"end_character":30},"updated":"2019-07-08 15:53:56.000000000","message":"Anything you raise out of something like this should be a subclass of NovaException","commit_id":"615b2d2f66332f38ac1530522a450ef546b10467"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"446bddc57728e9b97617db7a1ab73c06889479b6","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        url \u003d self.ARQ_URL"},{"line_number":166,"context_line":"        r \u003d self._client.patch(url, json\u003dpatch_list)"},{"line_number":167,"context_line":"        if not r:"},{"line_number":168,"context_line":"            raise RuntimeError(\u0027Failed to bind Cyborg accelerator requests\u0027)"}],"source_content_type":"text/x-python","patch_set":19,"id":"7faddb67_8d4937b8","line":168,"range":{"start_line":168,"start_character":18,"end_line":168,"end_character":30},"in_reply_to":"7faddb67_d5d071cc","updated":"2019-07-31 05:22:28.000000000","message":"Done","commit_id":"615b2d2f66332f38ac1530522a450ef546b10467"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"187cd4aee297cbde13ca0e5c2b069da990f39813","unresolved":false,"context_lines":[{"line_number":112,"context_line":"            raise exception.DeviceProfileError(name\u003ddp_name,"},{"line_number":113,"context_line":"                                               msg\u003d\u0027Invalid name\u0027)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        url \u003d self.ARQ_URL"},{"line_number":116,"context_line":"        data \u003d {\"device_profile_name\": dp_name}"},{"line_number":117,"context_line":"        r \u003d self._client.post(url, json\u003ddata)"},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_993036a0","line":115,"updated":"2019-11-25 19:27:39.000000000","message":"This does not save any bytes.","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"b4e8f1867465e95641ed5378b70055bc4a84bb2b","unresolved":false,"context_lines":[{"line_number":112,"context_line":"            raise exception.DeviceProfileError(name\u003ddp_name,"},{"line_number":113,"context_line":"                                               msg\u003d\u0027Invalid name\u0027)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        url \u003d self.ARQ_URL"},{"line_number":116,"context_line":"        data \u003d {\"device_profile_name\": dp_name}"},{"line_number":117,"context_line":"        r \u003d self._client.post(url, json\u003ddata)"},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_2fde4d3c","line":115,"in_reply_to":"3fa7e38b_993036a0","updated":"2019-12-02 17:09:10.000000000","message":"Done","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"187cd4aee297cbde13ca0e5c2b069da990f39813","unresolved":false,"context_lines":[{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        if not r:"},{"line_number":120,"context_line":"            raise exception.DeviceProfileError(name\u003ddp_name,"},{"line_number":121,"context_line":"                                               msg\u003d\u0027Invalid name\u0027)"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        return r.json().get(\u0027arqs\u0027)"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_39d82250","line":121,"range":{"start_line":121,"start_character":47,"end_line":121,"end_character":65},"updated":"2019-11-25 19:27:39.000000000","message":"This is a big assumption right? If it\u0027s 404, I agree, but if it\u0027s 500, or 403 or something else, this would be misleading.","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"b4e8f1867465e95641ed5378b70055bc4a84bb2b","unresolved":false,"context_lines":[{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        if not r:"},{"line_number":120,"context_line":"            raise exception.DeviceProfileError(name\u003ddp_name,"},{"line_number":121,"context_line":"                                               msg\u003d\u0027Invalid name\u0027)"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        return r.json().get(\u0027arqs\u0027)"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_efe7d50e","line":121,"range":{"start_line":121,"start_character":47,"end_line":121,"end_character":65},"in_reply_to":"3fa7e38b_39d82250","updated":"2019-12-02 17:09:10.000000000","message":"Done","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"187cd4aee297cbde13ca0e5c2b069da990f39813","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        :raises: DeviceProfileError, AcceleratorRequestOpFailed"},{"line_number":135,"context_line":"        \"\"\""},{"line_number":136,"context_line":"        LOG.info(\u0027Creating ARQs for device profile %s\u0027, dp_name)"},{"line_number":137,"context_line":"        arqs \u003d self._create_arqs(dp_name)"},{"line_number":138,"context_line":"        if arqs is None or len(arqs) \u003d\u003d 0:"},{"line_number":139,"context_line":"            raise exception.AcceleratorRequestOpFailed("},{"line_number":140,"context_line":"                op\u003d\u0027create\u0027, param\u003d\u0027device profile name %s\u0027 % dp_name)"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_f9ce0a81","line":137,"updated":"2019-11-25 19:27:39.000000000","message":"You\u0027re checking this as the success criteria. Will cyborg really return 200 OK with an empty body to signal that an HTTP resource create failed?","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"b4e8f1867465e95641ed5378b70055bc4a84bb2b","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        :raises: DeviceProfileError, AcceleratorRequestOpFailed"},{"line_number":135,"context_line":"        \"\"\""},{"line_number":136,"context_line":"        LOG.info(\u0027Creating ARQs for device profile %s\u0027, dp_name)"},{"line_number":137,"context_line":"        arqs \u003d self._create_arqs(dp_name)"},{"line_number":138,"context_line":"        if arqs is None or len(arqs) \u003d\u003d 0:"},{"line_number":139,"context_line":"            raise exception.AcceleratorRequestOpFailed("},{"line_number":140,"context_line":"                op\u003d\u0027create\u0027, param\u003d\u0027device profile name %s\u0027 % dp_name)"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_afbb1de2","line":137,"in_reply_to":"3fa7e38b_f9ce0a81","updated":"2019-12-02 17:09:10.000000000","message":"The create call can fail in a few ways:\n* No/bad HTTP response from Cyborg: caught in Line 119 above.\n* HTTP response is ok but there are no ARQs for whatever reason: handled here.","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"187cd4aee297cbde13ca0e5c2b069da990f39813","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        \"\"\""},{"line_number":136,"context_line":"        LOG.info(\u0027Creating ARQs for device profile %s\u0027, dp_name)"},{"line_number":137,"context_line":"        arqs \u003d self._create_arqs(dp_name)"},{"line_number":138,"context_line":"        if arqs is None or len(arqs) \u003d\u003d 0:"},{"line_number":139,"context_line":"            raise exception.AcceleratorRequestOpFailed("},{"line_number":140,"context_line":"                op\u003d\u0027create\u0027, param\u003d\u0027device profile name %s\u0027 % dp_name)"},{"line_number":141,"context_line":"        for arq in arqs:"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_19e1a6fc","line":138,"range":{"start_line":138,"start_character":8,"end_line":138,"end_character":41},"updated":"2019-11-25 19:27:39.000000000","message":"if not arqs","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"b4e8f1867465e95641ed5378b70055bc4a84bb2b","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        \"\"\""},{"line_number":136,"context_line":"        LOG.info(\u0027Creating ARQs for device profile %s\u0027, dp_name)"},{"line_number":137,"context_line":"        arqs \u003d self._create_arqs(dp_name)"},{"line_number":138,"context_line":"        if arqs is None or len(arqs) \u003d\u003d 0:"},{"line_number":139,"context_line":"            raise exception.AcceleratorRequestOpFailed("},{"line_number":140,"context_line":"                op\u003d\u0027create\u0027, param\u003d\u0027device profile name %s\u0027 % dp_name)"},{"line_number":141,"context_line":"        for arq in arqs:"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_4fb2a908","line":138,"range":{"start_line":138,"start_character":8,"end_line":138,"end_character":41},"in_reply_to":"3fa7e38b_19e1a6fc","updated":"2019-12-02 17:09:10.000000000","message":"Done","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"187cd4aee297cbde13ca0e5c2b069da990f39813","unresolved":false,"context_lines":[{"line_number":140,"context_line":"                op\u003d\u0027create\u0027, param\u003d\u0027device profile name %s\u0027 % dp_name)"},{"line_number":141,"context_line":"        for arq in arqs:"},{"line_number":142,"context_line":"            dp_group_id \u003d arq[\u0027device_profile_group_id\u0027]"},{"line_number":143,"context_line":"            arq[\u0027device_rp_uuid\u0027] \u003d None"},{"line_number":144,"context_line":"            requester_id \u003d ("},{"line_number":145,"context_line":"                get_device_profile_group_requester_id(dp_group_id))"},{"line_number":146,"context_line":"            arq[\u0027device_rp_uuid\u0027] \u003d rg_rp_map[requester_id][0]"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_b9c41261","line":143,"updated":"2019-11-25 19:27:39.000000000","message":"This is meaningless given L146","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"b4e8f1867465e95641ed5378b70055bc4a84bb2b","unresolved":false,"context_lines":[{"line_number":140,"context_line":"                op\u003d\u0027create\u0027, param\u003d\u0027device profile name %s\u0027 % dp_name)"},{"line_number":141,"context_line":"        for arq in arqs:"},{"line_number":142,"context_line":"            dp_group_id \u003d arq[\u0027device_profile_group_id\u0027]"},{"line_number":143,"context_line":"            arq[\u0027device_rp_uuid\u0027] \u003d None"},{"line_number":144,"context_line":"            requester_id \u003d ("},{"line_number":145,"context_line":"                get_device_profile_group_requester_id(dp_group_id))"},{"line_number":146,"context_line":"            arq[\u0027device_rp_uuid\u0027] \u003d rg_rp_map[requester_id][0]"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_6fb525ed","line":143,"in_reply_to":"3fa7e38b_b9c41261","updated":"2019-12-02 17:09:10.000000000","message":"Done","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"187cd4aee297cbde13ca0e5c2b069da990f39813","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                     } for field, value in binding.items()]"},{"line_number":174,"context_line":"            patch_list[arq_uuid] \u003d patch"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        url \u003d self.ARQ_URL"},{"line_number":177,"context_line":"        r \u003d self._client.patch(url, json\u003dpatch_list)"},{"line_number":178,"context_line":"        if not r:"},{"line_number":179,"context_line":"            arq_uuids \u003d list(bindings.keys())"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_39a6e2c1","line":176,"updated":"2019-11-25 19:27:39.000000000","message":"Again, this is more bytes than it saves.","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"b4e8f1867465e95641ed5378b70055bc4a84bb2b","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                     } for field, value in binding.items()]"},{"line_number":174,"context_line":"            patch_list[arq_uuid] \u003d patch"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        url \u003d self.ARQ_URL"},{"line_number":177,"context_line":"        r \u003d self._client.patch(url, json\u003dpatch_list)"},{"line_number":178,"context_line":"        if not r:"},{"line_number":179,"context_line":"            arq_uuids \u003d list(bindings.keys())"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_0fccb188","line":176,"in_reply_to":"3fa7e38b_39a6e2c1","updated":"2019-12-02 17:09:10.000000000","message":"Done","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"187cd4aee297cbde13ca0e5c2b069da990f39813","unresolved":false,"context_lines":[{"line_number":176,"context_line":"        url \u003d self.ARQ_URL"},{"line_number":177,"context_line":"        r \u003d self._client.patch(url, json\u003dpatch_list)"},{"line_number":178,"context_line":"        if not r:"},{"line_number":179,"context_line":"            arq_uuids \u003d list(bindings.keys())"},{"line_number":180,"context_line":"            param \u003d \u0027ARQ UUIDs %s\u0027 % \u0027,\u0027.join(arq_uuids)"},{"line_number":181,"context_line":"            raise exception.AcceleratorRequestOpFailed("},{"line_number":182,"context_line":"                op\u003d\u0027bind\u0027, param\u003dparam)"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_f9936a5a","line":179,"range":{"start_line":179,"start_character":24,"end_line":179,"end_character":29},"updated":"2019-11-25 19:27:39.000000000","message":"Why? You\u0027re making a copy of the keys, only to iterate them. Why not iterate the generator on the line below?","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"b4e8f1867465e95641ed5378b70055bc4a84bb2b","unresolved":false,"context_lines":[{"line_number":176,"context_line":"        url \u003d self.ARQ_URL"},{"line_number":177,"context_line":"        r \u003d self._client.patch(url, json\u003dpatch_list)"},{"line_number":178,"context_line":"        if not r:"},{"line_number":179,"context_line":"            arq_uuids \u003d list(bindings.keys())"},{"line_number":180,"context_line":"            param \u003d \u0027ARQ UUIDs %s\u0027 % \u0027,\u0027.join(arq_uuids)"},{"line_number":181,"context_line":"            raise exception.AcceleratorRequestOpFailed("},{"line_number":182,"context_line":"                op\u003d\u0027bind\u0027, param\u003dparam)"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_2fc72d68","line":179,"range":{"start_line":179,"start_character":24,"end_line":179,"end_character":29},"in_reply_to":"3fa7e38b_f9936a5a","updated":"2019-12-02 17:09:10.000000000","message":"Done","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b223f4d0583b0f4de2a6e7243b6c27636b35ae38","unresolved":false,"context_lines":[{"line_number":178,"context_line":"           :returns: nothing"},{"line_number":179,"context_line":"           :raises: AcceleratorRequestOpFailed"},{"line_number":180,"context_line":"        \"\"\""},{"line_number":181,"context_line":"        LOG.info(\u0027Binding ARQs. bindings \u003d %s\u0027, bindings)"},{"line_number":182,"context_line":"        # Create a JSON patch in RFC 6902 format"},{"line_number":183,"context_line":"        patch_list \u003d {}"},{"line_number":184,"context_line":"        for arq_uuid, binding in bindings.items():"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_88d94985","line":181,"updated":"2019-12-04 15:08:51.000000000","message":"This is not reasonable for info level","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"14c3bb47bd071a2e4542f5530e7a25f25f235769","unresolved":false,"context_lines":[{"line_number":178,"context_line":"           :returns: nothing"},{"line_number":179,"context_line":"           :raises: AcceleratorRequestOpFailed"},{"line_number":180,"context_line":"        \"\"\""},{"line_number":181,"context_line":"        LOG.info(\u0027Binding ARQs. bindings \u003d %s\u0027, bindings)"},{"line_number":182,"context_line":"        # Create a JSON patch in RFC 6902 format"},{"line_number":183,"context_line":"        patch_list \u003d {}"},{"line_number":184,"context_line":"        for arq_uuid, binding in bindings.items():"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_168a5619","line":181,"in_reply_to":"3fa7e38b_88d94985","updated":"2019-12-09 03:50:21.000000000","message":"Done","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6eaebb09d169b5c83b60e330286959b0e740144f","unresolved":false,"context_lines":[{"line_number":156,"context_line":"            raise exception.AcceleratorRequestOpFailed("},{"line_number":157,"context_line":"                op\u003d_(\u0027create\u0027), msg\u003derr_msg)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"        return resp.json().get(\u0027arqs\u0027)"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    def create_arqs_and_match_resource_providers(self, dp_name, rg_rp_map):"},{"line_number":162,"context_line":"        \"\"\"Create ARQs, match them with request groups and thereby"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_84f10d98","line":159,"range":{"start_line":159,"start_character":27,"end_line":159,"end_character":38},"updated":"2020-03-04 14:25:17.000000000","message":"Based on the Cyborg API a non-error response always contains the \u0027arqs\u0027 key. So you should use direct key access to make missing key error explicit if Cyborg does not behave as defined in the API ref.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"65d58351bad22fa57836ac9400ede66b75b19654","unresolved":false,"context_lines":[{"line_number":156,"context_line":"            raise exception.AcceleratorRequestOpFailed("},{"line_number":157,"context_line":"                op\u003d_(\u0027create\u0027), msg\u003derr_msg)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"        return resp.json().get(\u0027arqs\u0027)"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    def create_arqs_and_match_resource_providers(self, dp_name, rg_rp_map):"},{"line_number":162,"context_line":"        \"\"\"Create ARQs, match them with request groups and thereby"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_96b4a381","line":159,"range":{"start_line":159,"start_character":27,"end_line":159,"end_character":38},"in_reply_to":"1fa4df85_84f10d98","updated":"2020-03-08 23:24:35.000000000","message":"\u003e Based on the Cyborg API a non-error response always contains the\n \u003e \u0027arqs\u0027 key. \n\nTrue, in the current definition. However, instead of assuming a specific Cyborg behavior, Nova should check its assumptions explicitly. We do that by returning None if \u0027arqs\u0027 key is absent, and checking for None below.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6eaebb09d169b5c83b60e330286959b0e740144f","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        \"\"\""},{"line_number":172,"context_line":"        LOG.info(\u0027Creating ARQs for device profile %s\u0027, dp_name)"},{"line_number":173,"context_line":"        arqs \u003d self._create_arqs(dp_name)"},{"line_number":174,"context_line":"        if not arqs or len(arqs) \u003d\u003d 0:"},{"line_number":175,"context_line":"            msg \u003d _(\u0027device profile name %s\u0027) % dp_name"},{"line_number":176,"context_line":"            raise exception.AcceleratorRequestOpFailed(op\u003d_(\u0027create\u0027), msg\u003dmsg)"},{"line_number":177,"context_line":"        for arq in arqs:"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_c42945e6","line":174,"range":{"start_line":174,"start_character":11,"end_line":174,"end_character":19},"updated":"2020-03-04 14:25:17.000000000","message":"I think None could not happen based on the Cyborg API ref.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6eaebb09d169b5c83b60e330286959b0e740144f","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        \"\"\""},{"line_number":172,"context_line":"        LOG.info(\u0027Creating ARQs for device profile %s\u0027, dp_name)"},{"line_number":173,"context_line":"        arqs \u003d self._create_arqs(dp_name)"},{"line_number":174,"context_line":"        if not arqs or len(arqs) \u003d\u003d 0:"},{"line_number":175,"context_line":"            msg \u003d _(\u0027device profile name %s\u0027) % dp_name"},{"line_number":176,"context_line":"            raise exception.AcceleratorRequestOpFailed(op\u003d_(\u0027create\u0027), msg\u003dmsg)"},{"line_number":177,"context_line":"        for arq in arqs:"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_24bb7972","line":174,"range":{"start_line":174,"start_character":23,"end_line":174,"end_character":38},"updated":"2020-03-04 14:25:17.000000000","message":"So POST /accelerator_request returned a non-error response but in the response there is no arqs. How this can happen in cyborg? Could there be device profiles that indicate that zero arq is needed? If yes then I don\u0027t see why that needs to be handled as an error here.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"65d58351bad22fa57836ac9400ede66b75b19654","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        \"\"\""},{"line_number":172,"context_line":"        LOG.info(\u0027Creating ARQs for device profile %s\u0027, dp_name)"},{"line_number":173,"context_line":"        arqs \u003d self._create_arqs(dp_name)"},{"line_number":174,"context_line":"        if not arqs or len(arqs) \u003d\u003d 0:"},{"line_number":175,"context_line":"            msg \u003d _(\u0027device profile name %s\u0027) % dp_name"},{"line_number":176,"context_line":"            raise exception.AcceleratorRequestOpFailed(op\u003d_(\u0027create\u0027), msg\u003dmsg)"},{"line_number":177,"context_line":"        for arq in arqs:"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_56aaab18","line":174,"range":{"start_line":174,"start_character":11,"end_line":174,"end_character":19},"in_reply_to":"1fa4df85_532195af","updated":"2020-03-08 23:24:35.000000000","message":"Yes. Cyborg is expected to return non-zero ARQs. Nova should codify that expectation by checking for it and erroring out if false.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"876b576e3cfe4780860469091e44c36fd145fcc1","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        \"\"\""},{"line_number":172,"context_line":"        LOG.info(\u0027Creating ARQs for device profile %s\u0027, dp_name)"},{"line_number":173,"context_line":"        arqs \u003d self._create_arqs(dp_name)"},{"line_number":174,"context_line":"        if not arqs or len(arqs) \u003d\u003d 0:"},{"line_number":175,"context_line":"            msg \u003d _(\u0027device profile name %s\u0027) % dp_name"},{"line_number":176,"context_line":"            raise exception.AcceleratorRequestOpFailed(op\u003d_(\u0027create\u0027), msg\u003dmsg)"},{"line_number":177,"context_line":"        for arq in arqs:"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_532195af","line":174,"range":{"start_line":174,"start_character":11,"end_line":174,"end_character":19},"in_reply_to":"1fa4df85_c42945e6","updated":"2020-03-04 14:42:36.000000000","message":"I think zero ARQs has to be treated as an error, at least for the moment. That may not be a hard requirement for cyborg, but for us, zero ARQs will mean the disabling of all the accelerator-related code in nova that followed this. Meaning, we won\u0027t ask for any resources in placement, we won\u0027t do the bind step in conductor, and we won\u0027t do any of the compute node (virt driver) stuff. So, it seems prudent to consider the presence of a device profile and no ARQs to be an error from Nova\u0027s perspective.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6eaebb09d169b5c83b60e330286959b0e740144f","unresolved":false,"context_lines":[{"line_number":200,"context_line":"           :raises: AcceleratorRequestOpFailed"},{"line_number":201,"context_line":"        \"\"\""},{"line_number":202,"context_line":"        LOG.info(\u0027Binding ARQs.\u0027)"},{"line_number":203,"context_line":"        LOG.info(\u0027ARQ bindings \u003d %s\u0027, bindings)  # XXX"},{"line_number":204,"context_line":"        # Create a JSON patch in RFC 6902 format"},{"line_number":205,"context_line":"        patch_list \u003d {}"},{"line_number":206,"context_line":"        for arq_uuid, binding in bindings.items():"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_4701d704","line":203,"range":{"start_line":203,"start_character":49,"end_line":203,"end_character":54},"updated":"2020-03-04 14:25:17.000000000","message":"What does this mean? Do you have a TODO here?","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"876b576e3cfe4780860469091e44c36fd145fcc1","unresolved":false,"context_lines":[{"line_number":200,"context_line":"           :raises: AcceleratorRequestOpFailed"},{"line_number":201,"context_line":"        \"\"\""},{"line_number":202,"context_line":"        LOG.info(\u0027Binding ARQs.\u0027)"},{"line_number":203,"context_line":"        LOG.info(\u0027ARQ bindings \u003d %s\u0027, bindings)  # XXX"},{"line_number":204,"context_line":"        # Create a JSON patch in RFC 6902 format"},{"line_number":205,"context_line":"        patch_list \u003d {}"},{"line_number":206,"context_line":"        for arq_uuid, binding in bindings.items():"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_7305b113","line":203,"range":{"start_line":203,"start_character":49,"end_line":203,"end_character":54},"in_reply_to":"1fa4df85_4701d704","updated":"2020-03-04 14:42:36.000000000","message":"I think this means \"remove this\" and agree it should be removed.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"65d58351bad22fa57836ac9400ede66b75b19654","unresolved":false,"context_lines":[{"line_number":200,"context_line":"           :raises: AcceleratorRequestOpFailed"},{"line_number":201,"context_line":"        \"\"\""},{"line_number":202,"context_line":"        LOG.info(\u0027Binding ARQs.\u0027)"},{"line_number":203,"context_line":"        LOG.info(\u0027ARQ bindings \u003d %s\u0027, bindings)  # XXX"},{"line_number":204,"context_line":"        # Create a JSON patch in RFC 6902 format"},{"line_number":205,"context_line":"        patch_list \u003d {}"},{"line_number":206,"context_line":"        for arq_uuid, binding in bindings.items():"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_76a56746","line":203,"range":{"start_line":203,"start_character":49,"end_line":203,"end_character":54},"in_reply_to":"1fa4df85_7305b113","updated":"2020-03-08 23:24:35.000000000","message":"Sorry, will remove.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6eaebb09d169b5c83b60e330286959b0e740144f","unresolved":false,"context_lines":[{"line_number":253,"context_line":"            raise exception.AcceleratorRequestOpFailed("},{"line_number":254,"context_line":"                op\u003d_(\u0027get\u0027), msg\u003derr_msg)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"        arqs \u003d resp.json()[\u0027arqs\u0027]"},{"line_number":257,"context_line":"        if only_resolved:"},{"line_number":258,"context_line":"            arqs \u003d [arq for arq in arqs if"},{"line_number":259,"context_line":"                    arq[\u0027state\u0027] in [\u0027Bound\u0027, \u0027BindFailed\u0027, \u0027Deleting\u0027]]"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_677df37d","line":256,"range":{"start_line":256,"start_character":26,"end_line":256,"end_character":34},"updated":"2020-03-04 14:25:17.000000000","message":"yes!","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"f231c8e97ec4a079f4e0d040b61efc31e63ee7e0","unresolved":false,"context_lines":[{"line_number":253,"context_line":"            raise exception.AcceleratorRequestOpFailed("},{"line_number":254,"context_line":"                op\u003d_(\u0027get\u0027), msg\u003derr_msg)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"        arqs \u003d resp.json()[\u0027arqs\u0027]"},{"line_number":257,"context_line":"        if only_resolved:"},{"line_number":258,"context_line":"            arqs \u003d [arq for arq in arqs if"},{"line_number":259,"context_line":"                    arq[\u0027state\u0027] in [\u0027Bound\u0027, \u0027BindFailed\u0027, \u0027Deleting\u0027]]"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_440f3187","line":256,"range":{"start_line":256,"start_character":26,"end_line":256,"end_character":34},"in_reply_to":"1fa4df85_40cf2628","updated":"2020-03-11 19:20:18.000000000","message":"Agreed it should be fixed here too.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"cd157bf1019f7e268897eeb4d6b98ce5e47049fe","unresolved":false,"context_lines":[{"line_number":253,"context_line":"            raise exception.AcceleratorRequestOpFailed("},{"line_number":254,"context_line":"                op\u003d_(\u0027get\u0027), msg\u003derr_msg)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"        arqs \u003d resp.json()[\u0027arqs\u0027]"},{"line_number":257,"context_line":"        if only_resolved:"},{"line_number":258,"context_line":"            arqs \u003d [arq for arq in arqs if"},{"line_number":259,"context_line":"                    arq[\u0027state\u0027] in [\u0027Bound\u0027, \u0027BindFailed\u0027, \u0027Deleting\u0027]]"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_40cf2628","line":256,"range":{"start_line":256,"start_character":26,"end_line":256,"end_character":34},"in_reply_to":"1fa4df85_677df37d","updated":"2020-03-10 17:17:27.000000000","message":"If above (L159) we say that the existence of the args key should be checked explicitly then why not doing that here? I\u0027m confused.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"23a64313d3acef9ac99b0b40a93545acb0c2b25b","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        \"\"\""},{"line_number":172,"context_line":"        LOG.info(\u0027Creating ARQs for device profile %s\u0027, dp_name)"},{"line_number":173,"context_line":"        arqs \u003d self._create_arqs(dp_name)"},{"line_number":174,"context_line":"        if not arqs or len(arqs) \u003d\u003d 0:"},{"line_number":175,"context_line":"            msg \u003d _(\u0027device profile name %s\u0027) % dp_name"},{"line_number":176,"context_line":"            raise exception.AcceleratorRequestOpFailed(op\u003d_(\u0027create\u0027), msg\u003dmsg)"},{"line_number":177,"context_line":"        for arq in arqs:"}],"source_content_type":"text/x-python","patch_set":69,"id":"df33271e_5b198877","line":174,"range":{"start_line":174,"start_character":19,"end_line":174,"end_character":37},"updated":"2020-03-23 17:30:23.000000000","message":"nit: i dont think this is required.\n\nbool([]) is false\nso if is an empty list this will raise an exception.\ne.g.\narqs \u003d []\nif not arqs:\n      msg \u003d _(\u0027device profile name %s\u0027) % dp_name\n            raise exception.AcceleratorRequestOpFailed(op\u003d_(\u0027create\u0027), msg\u003dmsg)\n\n\nos the \u0027or len(arqs) \u003d\u003d 0\u0027 is  not required.","commit_id":"cc630b4eb62c4a45ff08a1862a8339a0f129e0a3"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"23a64313d3acef9ac99b0b40a93545acb0c2b25b","unresolved":false,"context_lines":[{"line_number":176,"context_line":"            raise exception.AcceleratorRequestOpFailed(op\u003d_(\u0027create\u0027), msg\u003dmsg)"},{"line_number":177,"context_line":"        for arq in arqs:"},{"line_number":178,"context_line":"            dp_group_id \u003d arq[\u0027device_profile_group_id\u0027]"},{"line_number":179,"context_line":"            arq[\u0027device_rp_uuid\u0027] \u003d None"},{"line_number":180,"context_line":"            requester_id \u003d ("},{"line_number":181,"context_line":"                get_device_profile_group_requester_id(dp_group_id))"},{"line_number":182,"context_line":"            arq[\u0027device_rp_uuid\u0027] \u003d rg_rp_map[requester_id][0]"},{"line_number":183,"context_line":"        return arqs"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    def bind_arqs(self, bindings):"}],"source_content_type":"text/x-python","patch_set":69,"id":"df33271e_bb9a54c2","line":182,"range":{"start_line":179,"start_character":11,"end_line":182,"end_character":62},"updated":"2020-03-23 17:30:23.000000000","message":"this could be\n\nrequester_id \u003d (\nget_device_profile_group_requester_id(dp_group_id))\narq[\u0027device_rp_uuid\u0027] \u003d rg_rp_map.get(requester_id,[None])[0]","commit_id":"cc630b4eb62c4a45ff08a1862a8339a0f129e0a3"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"23a64313d3acef9ac99b0b40a93545acb0c2b25b","unresolved":false,"context_lines":[{"line_number":185,"context_line":"    def bind_arqs(self, bindings):"},{"line_number":186,"context_line":"        \"\"\"Initiate Cyborg bindings."},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"           Handles RFC 6902-compliant JSON patching, sparing"},{"line_number":189,"context_line":"           calling Nova code from those details."},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"           :param bindings:"},{"line_number":192,"context_line":"               { \"$arq_uuid\": {"}],"source_content_type":"text/x-python","patch_set":69,"id":"df33271e_bbd1b45a","line":189,"range":{"start_line":188,"start_character":11,"end_line":189,"end_character":48},"updated":"2020-03-23 17:30:23.000000000","message":"im assuming this function is correct since i dont have time today to read RFC 6902 and determin if this is correct or not.","commit_id":"cc630b4eb62c4a45ff08a1862a8339a0f129e0a3"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"52ea6779ffd607bc73a803887c69133297356a9e","unresolved":false,"context_lines":[{"line_number":211,"context_line":""},{"line_number":212,"context_line":"        resp, err_msg \u003d self._call_cyborg(self._client.patch,"},{"line_number":213,"context_line":"             self.ARQ_URL, json\u003dpatch_list)"},{"line_number":214,"context_line":"        if err_msg:"},{"line_number":215,"context_line":"            msg \u003d _(\u0027 Binding failed for ARQ UUIDs: \u0027)"},{"line_number":216,"context_line":"            err_msg \u003d err_msg + msg + \u0027,\u0027.join(bindings.keys())"},{"line_number":217,"context_line":"            raise exception.AcceleratorRequestOpFailed("}],"source_content_type":"text/x-python","patch_set":69,"id":"df33271e_bf27ceb6","line":214,"range":{"start_line":214,"start_character":11,"end_line":214,"end_character":18},"updated":"2020-03-24 12:46:39.000000000","message":"If bind arqs failed, we should cleanup the arq bind info, because we already create the arqs and matched the resource providers, otherwise the arqs in Cyborg db that will be an occupied resource, it cannot be requested in next cycle.\n\nIn cyborg we will be not allow duplicate binding request, see https://review.opendev.org/#/c/712231/4/cyborg/api/controllers/v2/arqs.py@274","commit_id":"cc630b4eb62c4a45ff08a1862a8339a0f129e0a3"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"17425d5b6f1a11e1e10c735bbfdba94cb8b5262c","unresolved":false,"context_lines":[{"line_number":211,"context_line":""},{"line_number":212,"context_line":"        resp, err_msg \u003d self._call_cyborg(self._client.patch,"},{"line_number":213,"context_line":"             self.ARQ_URL, json\u003dpatch_list)"},{"line_number":214,"context_line":"        if err_msg:"},{"line_number":215,"context_line":"            msg \u003d _(\u0027 Binding failed for ARQ UUIDs: \u0027)"},{"line_number":216,"context_line":"            err_msg \u003d err_msg + msg + \u0027,\u0027.join(bindings.keys())"},{"line_number":217,"context_line":"            raise exception.AcceleratorRequestOpFailed("}],"source_content_type":"text/x-python","patch_set":69,"id":"df33271e_c6ca9d6c","line":214,"range":{"start_line":214,"start_character":11,"end_line":214,"end_character":18},"in_reply_to":"df33271e_bf27ceb6","updated":"2020-03-26 14:59:21.000000000","message":"See discussion in https://review.opendev.org/#/c/673735/46/nova/conductor/manager.py@1632","commit_id":"cc630b4eb62c4a45ff08a1862a8339a0f129e0a3"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"23a64313d3acef9ac99b0b40a93545acb0c2b25b","unresolved":false,"context_lines":[{"line_number":217,"context_line":"            raise exception.AcceleratorRequestOpFailed("},{"line_number":218,"context_line":"                op\u003d_(\u0027bind\u0027), msg\u003derr_msg)"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"    def get_arqs_for_instance(self, instance_uuid, only_resolved\u003dFalse):"},{"line_number":221,"context_line":"        \"\"\"Get ARQs for the instance."},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"           :param instance_uuid: Instance UUID"}],"source_content_type":"text/x-python","patch_set":69,"id":"df33271e_5b5188d8","line":220,"range":{"start_line":220,"start_character":51,"end_line":220,"end_character":64},"updated":"2020-03-23 17:30:23.000000000","message":"you could have made this more generic, so this could be \"bound\" but i guess this works too, or more generically \"states\".\n\ni.e. states\u003dNone\nthen when filtering below you would filter on the state passed in.\n\ne.g.\n  if states:\n      arqs \u003d [arq for arq in arqs if arq[\u0027state\u0027] in states]","commit_id":"cc630b4eb62c4a45ff08a1862a8339a0f129e0a3"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"17425d5b6f1a11e1e10c735bbfdba94cb8b5262c","unresolved":false,"context_lines":[{"line_number":217,"context_line":"            raise exception.AcceleratorRequestOpFailed("},{"line_number":218,"context_line":"                op\u003d_(\u0027bind\u0027), msg\u003derr_msg)"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"    def get_arqs_for_instance(self, instance_uuid, only_resolved\u003dFalse):"},{"line_number":221,"context_line":"        \"\"\"Get ARQs for the instance."},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"           :param instance_uuid: Instance UUID"}],"source_content_type":"text/x-python","patch_set":69,"id":"df33271e_46bfadcf","line":220,"range":{"start_line":220,"start_character":51,"end_line":220,"end_character":64},"in_reply_to":"df33271e_5b5188d8","updated":"2020-03-26 14:59:21.000000000","message":"The term \u0027resolved\u0027 means the ARQ state is one of [\u0027Bound\u0027, \u0027BindFailed\u0027, \u0027Deleting\u0027]. That knowledge is isolated here -- we don;t want the callers to check for specific ARQ states.","commit_id":"cc630b4eb62c4a45ff08a1862a8339a0f129e0a3"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"17425d5b6f1a11e1e10c735bbfdba94cb8b5262c","unresolved":false,"context_lines":[{"line_number":217,"context_line":"            raise exception.AcceleratorRequestOpFailed("},{"line_number":218,"context_line":"                op\u003d_(\u0027bind\u0027), msg\u003derr_msg)"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"    def get_arqs_for_instance(self, instance_uuid, only_resolved\u003dFalse):"},{"line_number":221,"context_line":"        \"\"\"Get ARQs for the instance."},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"           :param instance_uuid: Instance UUID"}],"source_content_type":"text/x-python","patch_set":69,"id":"df33271e_a6283934","line":220,"range":{"start_line":220,"start_character":51,"end_line":220,"end_character":64},"in_reply_to":"df33271e_5b5188d8","updated":"2020-03-26 14:59:21.000000000","message":"The term \u0027resolved\u0027 means the state","commit_id":"cc630b4eb62c4a45ff08a1862a8339a0f129e0a3"}],"nova/compute/manager.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"63478cad20b7366da634fb3322b5bb34c4fce0b6","unresolved":false,"context_lines":[{"line_number":2606,"context_line":"        dp_name \u003d instance.flavor.extra_specs.get(\u0027accel:device_profile\u0027)"},{"line_number":2607,"context_line":"        timeout \u003d CONF.arq_binding_timeout or None"},{"line_number":2608,"context_line":"        if dp_name:"},{"line_number":2609,"context_line":"            arq_events \u003d [(\u0027accelerator-requests-bound\u0027, dp_name)]"},{"line_number":2610,"context_line":"            LOG.info(\u0027Waiting for ARQ binding for device profile %s \u0027"},{"line_number":2611,"context_line":"                     \u0027with timeout %d\u0027, dp_name, timeout)"},{"line_number":2612,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":43,"id":"3fa7e38b_c9427c68","line":2609,"range":{"start_line":2609,"start_character":28,"end_line":2609,"end_character":54},"updated":"2019-11-01 14:48:44.000000000","message":"This doesn\u0027t exist until the next patch. This patch can\u0027t possibly work and would just hang forever waiting for this event, which can\u0027t physically be put into the event object...\n\nI would ask how this is is being tested in such a broken state, but skimming over the patch, I\u0027d say it looks like it just isn\u0027t.","commit_id":"5e66540fadf3a183d225d69f5f89fe33a585b8ef"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"187cd4aee297cbde13ca0e5c2b069da990f39813","unresolved":false,"context_lines":[{"line_number":2586,"context_line":"    def _build_resources(self, context, instance, requested_networks,"},{"line_number":2587,"context_line":"                         security_groups, image_meta, block_device_mapping,"},{"line_number":2588,"context_line":"                         resource_provider_mapping):"},{"line_number":2589,"context_line":"        resources \u003d {}"},{"line_number":2590,"context_line":"        network_info \u003d None"},{"line_number":2591,"context_line":"        try:"},{"line_number":2592,"context_line":"            LOG.debug(\u0027Start building networks asynchronously for instance.\u0027,"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_f9cfea53","side":"PARENT","line":2589,"updated":"2019-11-25 19:27:39.000000000","message":"Why have you changed this method so much? It\u0027s hard to even suss out what change you have made here, but I can say that the handling here due to network events is extremely fragile, so changing all of this makes me very concerned.","commit_id":"e46ef0a8cff3e845a1508eb1173259e53cb2d13b"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"187cd4aee297cbde13ca0e5c2b069da990f39813","unresolved":false,"context_lines":[{"line_number":2635,"context_line":"            resources[\u0027block_device_info\u0027] \u003d block_device_info"},{"line_number":2636,"context_line":"        except (exception.InstanceNotFound,"},{"line_number":2637,"context_line":"                exception.UnexpectedDeletingTaskStateError):"},{"line_number":2638,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":2639,"context_line":"                # Make sure the async call finishes"},{"line_number":2640,"context_line":"                if network_info is not None:"},{"line_number":2641,"context_line":"                    network_info.wait(do_raise\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_19d526b7","side":"PARENT","line":2638,"updated":"2019-11-25 19:27:39.000000000","message":"This is removed from the new code?!","commit_id":"e46ef0a8cff3e845a1508eb1173259e53cb2d13b"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"187cd4aee297cbde13ca0e5c2b069da990f39813","unresolved":false,"context_lines":[{"line_number":2623,"context_line":"        else:"},{"line_number":2624,"context_line":"            arq_events \u003d []"},{"line_number":2625,"context_line":""},{"line_number":2626,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2627,"context_line":"            instance, arq_events, deadline\u003dtimeout):"},{"line_number":2628,"context_line":"            # This will prepare non-accelerator resources while"},{"line_number":2629,"context_line":"            # waiting for the Cyborg ARQ bound event. The actual"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_59815ec1","line":2626,"updated":"2019-11-25 19:27:39.000000000","message":"It looks like you have nested the entire bulk of this method within your event waiter. What that means is you will run all of this code immediately, and the block until the event comes. For something that isn\u0027t related to accelerator resources, that makes no sense to me. Further, it complicates the cleanup path. I don\u0027t see you cleaning up these ARQs if network or block device stuff fails, and if you make it through all of that but we don\u0027t get the event (in time) from cyborg, you will raise a generic exception and not (AFAICT) clean up all the block device and network mess that you made.\n\nBasically, I\u0027m saying that unless the binding operation is a very long task, none of it should be done async like this, and if it is, I would tend to thing we should/could do that either before or after all the network and block device stuff, not in parallel, just for simplicity of doing the cleanup.","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0b2baca4aba2bf8597713536efdf22b9d675dd3f","unresolved":false,"context_lines":[{"line_number":2624,"context_line":"            arq_events \u003d []"},{"line_number":2625,"context_line":""},{"line_number":2626,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2627,"context_line":"            instance, arq_events, deadline\u003dtimeout):"},{"line_number":2628,"context_line":"            # This will prepare non-accelerator resources while"},{"line_number":2629,"context_line":"            # waiting for the Cyborg ARQ bound event. The actual"},{"line_number":2630,"context_line":"            # query to get bound ARQs happens in the virt driver\u0027s"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_e49def58","line":2627,"updated":"2019-11-26 19:11:51.000000000","message":"I put up this:\n\nhttps://review.opendev.org/#/c/695985/\n\nWhich will allow us to kick off the process from conductor like we originally discussed. It will allow us to make this a lot cleaner and less impactful. If the bind process is started from conductor, then in compute all we need to do is the following (pseudocode):\n\n with self.virtapi.wait_for_instance_event(instance, arq_events, deadline\u003dtimeout):\n     early_events \u003d check_for_binding_completed(instance, arq_events)\n     self.virtapi.exit_wait_early(early_events)\n\nIf the event(s) haven\u0027t come yet, early_events will be empty, and we will wait for them as you would expect. If they *have* already come, we will return the names of the events and the exit will cause us to proceed immediately. The check_for_binding_completed() merely needs to poll cyborg once to see if binding is done for some/all of the expected ARQs. By doing that single poll within the waiting context, we know we\u0027re setup to receive the event before the poll, and after the poll, we know whether or not we need to wait or not.\n\nI would recommend that we move that from build_resources where you have it here to be closer to the actual spawn (or perhaps in the virt driver to get overlap with the image download).\n\nMake sense?","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"88ca2b5c81cf6ae60898db5d28c583483ef23234","unresolved":false,"context_lines":[{"line_number":2624,"context_line":"            arq_events \u003d []"},{"line_number":2625,"context_line":""},{"line_number":2626,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2627,"context_line":"            instance, arq_events, deadline\u003dtimeout):"},{"line_number":2628,"context_line":"            # This will prepare non-accelerator resources while"},{"line_number":2629,"context_line":"            # waiting for the Cyborg ARQ bound event. The actual"},{"line_number":2630,"context_line":"            # query to get bound ARQs happens in the virt driver\u0027s"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_bd6fe591","line":2627,"in_reply_to":"3fa7e38b_3a753b01","updated":"2019-11-29 02:28:50.000000000","message":"Sounds like the bind needs to be kicked off a tad later, after the host is associated with the instance.\n\nPretty sure the virtapi is a property on the ComputeDriver.\n\nCan look closer at these things next week.","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d832144a0ad3b62c21a94672ec8a43da0ff0fb83","unresolved":false,"context_lines":[{"line_number":2624,"context_line":"            arq_events \u003d []"},{"line_number":2625,"context_line":""},{"line_number":2626,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2627,"context_line":"            instance, arq_events, deadline\u003dtimeout):"},{"line_number":2628,"context_line":"            # This will prepare non-accelerator resources while"},{"line_number":2629,"context_line":"            # waiting for the Cyborg ARQ bound event. The actual"},{"line_number":2630,"context_line":"            # query to get bound ARQs happens in the virt driver\u0027s"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_8224eb61","line":2627,"in_reply_to":"3fa7e38b_4c338cf8","updated":"2019-12-02 18:12:16.000000000","message":"\u003e Not really. This would happen with any device when Cyborg can\n \u003e determine that no device prep is needed. For example, if an FPGA\n \u003e already has the bitstream that is needed, we\u0027ll skip that step,\n \u003e complete the bind and generate the notification.\n\nAck, this is good to note. We don\u0027t want the race to exist anyway, but it\u0027s good to note a non-fake situation where we\u0027ll get nearly instantaneous bind completion.","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"17980b2b39657499b9259803db1b35412554fa2d","unresolved":false,"context_lines":[{"line_number":2624,"context_line":"            arq_events \u003d []"},{"line_number":2625,"context_line":""},{"line_number":2626,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2627,"context_line":"            instance, arq_events, deadline\u003dtimeout):"},{"line_number":2628,"context_line":"            # This will prepare non-accelerator resources while"},{"line_number":2629,"context_line":"            # waiting for the Cyborg ARQ bound event. The actual"},{"line_number":2630,"context_line":"            # query to get bound ARQs happens in the virt driver\u0027s"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_a75b3984","line":2627,"in_reply_to":"3fa7e38b_4c338cf8","updated":"2019-12-02 17:30:41.000000000","message":"\u003e Yes, I could make the notification as a best effort in Cyborg --\n \u003e try it once and not fail the binding itself if it fails.\n\nOnly if it fails with this specific condition, which you can determine via HTTP 207 + event[\u0027code\u0027] 422.\n\n \u003e Are you saying this is the entire solution?\n\nYes.\n\n \u003e In most cases (all\n \u003e cases with the fake driver, and many/most cases with real drivers),\n \u003e the notification will get lost.\n\nThe point is, that\u0027s what we want. The \"lost\" events are among the ones that will be canceled via exit_wait_early.\n\nFor completeness, there are three good paths. When binding completes...\n\n1) ...before the instance lands on the compute: The event is rejected with 422. We enter wait_for_instance_event and query cyborg, which tells us the binding is complete, so we exit_wait_early.\n\n2) ...after the instance lands on compute, but before we enter wait_for_instance_event: The event is accepted and sent to the compute, which ignores it. We enter wait_for_instance_event and query cyborg, which tells us the binding is complete, so we exit_wait_early.\n\n3) ...after we enter wait_for_instance_event: We queried cyborg and found the binding was *not* complete, so we didn\u0027t exit_wait_early. Once the binding completes, the event is emitted and wait_for_instance_event exits.\n\n \u003e Secondly, to elaborate on the pseudocode:\n\nAck; I don\u0027t see anything there that\u0027s problematic.","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"fd0792b6585ca983c36d67bcc0e4fedfc61279bd","unresolved":false,"context_lines":[{"line_number":2624,"context_line":"            arq_events \u003d []"},{"line_number":2625,"context_line":""},{"line_number":2626,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2627,"context_line":"            instance, arq_events, deadline\u003dtimeout):"},{"line_number":2628,"context_line":"            # This will prepare non-accelerator resources while"},{"line_number":2629,"context_line":"            # waiting for the Cyborg ARQ bound event. The actual"},{"line_number":2630,"context_line":"            # query to get bound ARQs happens in the virt driver\u0027s"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_96d0b1ca","line":2627,"in_reply_to":"3fa7e38b_6131b459","updated":"2019-12-02 15:19:21.000000000","message":"\u003e \u003e Pretty sure the virtapi is a property on the ComputeDriver.\n \u003e \n \u003e Confirmed, self.virtapi. Here\u0027s a precedent [1].\n\nVirtAPI is a thing that is provided _to_ the driver _by_ compute manager as a set of services or callbacks.\n\n \u003e \u003e When the bind is kicked off from the conductor, the Cyborg\n \u003e \u003e notification event may come soon, before the instance is\n \u003e associated\n \u003e \u003e with a host in the compute manager.\n \u003e \n \u003e Wait, are you saying associating the instance with a host happens\n \u003e at compute, not conductor?\n \u003e \n \u003e [Later] Confirmed. _build_and_run_instance does instance_claim [2]\n \u003e which does _set_instance_host_and_node [3] which sets the host on\n \u003e the instance [4].\n \u003e \n \u003e But the host is sent in the payload of the binding API; why does\n \u003e cyborg care whether the instance is associated with the host in\n \u003e nova\u0027s database?\n \u003e \n \u003e [Later later] Oh, I see, the error is coming from nova when the\n \u003e event is created, where the host is checked because [5], which\n \u003e makes sense.\n \u003e \n \u003e Can the cyborg side just retry on that 422 until the event is\n \u003e accepted?\n\nRight, you figured all of this out, but yes, instance.host isn\u0027t set until the compute is sure it\u0027s going to get it. That\u0027s problematic in lots of areas, but it\u0027s also our sign that the instance is staying. I\u0027m guessing that this only really happens with a fake cyborg driver because it completes immediately, right? Still, that leaves a race even with a real driver.\n\nMoving the bind until after we\u0027ve set instance.host makes it very late in the process, which is what we\u0027re trying to avoid. Also, making cyborg queue and retry the event seems too much to ask, IMHO. Nova would have a hard time doing that, and I don\u0027t doubt cyborg would as well.\n\nOne option is to just have cyborg not freak out about the 422 when sending the event, since we know we\u0027re asking it to do the work early and it may complete before we\u0027re ready. A 404 means the instance doesn\u0027t exist or was deleted mid-flight. 422 means \"Cyborg won\" but that\u0027s not really a problem.","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"b4e8f1867465e95641ed5378b70055bc4a84bb2b","unresolved":false,"context_lines":[{"line_number":2624,"context_line":"            arq_events \u003d []"},{"line_number":2625,"context_line":""},{"line_number":2626,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2627,"context_line":"            instance, arq_events, deadline\u003dtimeout):"},{"line_number":2628,"context_line":"            # This will prepare non-accelerator resources while"},{"line_number":2629,"context_line":"            # waiting for the Cyborg ARQ bound event. The actual"},{"line_number":2630,"context_line":"            # query to get bound ARQs happens in the virt driver\u0027s"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_09dca6df","line":2627,"in_reply_to":"3fa7e38b_6131b459","updated":"2019-12-02 17:09:10.000000000","message":"\u003e Can the cyborg side just retry on that 422 until the event is\n \u003e accepted?\n\nWe started with Nova polling on Cyborg, which was not considered an optimal solution. By the same token, Cyborg polling on Nova is not the best solution either.","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"b4e8f1867465e95641ed5378b70055bc4a84bb2b","unresolved":false,"context_lines":[{"line_number":2624,"context_line":"            arq_events \u003d []"},{"line_number":2625,"context_line":""},{"line_number":2626,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2627,"context_line":"            instance, arq_events, deadline\u003dtimeout):"},{"line_number":2628,"context_line":"            # This will prepare non-accelerator resources while"},{"line_number":2629,"context_line":"            # waiting for the Cyborg ARQ bound event. The actual"},{"line_number":2630,"context_line":"            # query to get bound ARQs happens in the virt driver\u0027s"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_4c338cf8","line":2627,"in_reply_to":"3fa7e38b_96d0b1ca","updated":"2019-12-02 17:09:10.000000000","message":"\u003e I\u0027m guessing that this only really happens\n \u003e with a fake cyborg driver because it completes immediately, right?\n\nNot really. This would happen with any device when Cyborg can determine that no device prep is needed. For example, if an FPGA already has the bitstream that is needed, we\u0027ll skip that step, complete the bind and generate the notification.\n\n \u003e Still, that leaves a race even with a real driver.\n\nYes.\n\n \u003e Moving the bind until after we\u0027ve set instance.host makes it very\n \u003e late in the process, which is what we\u0027re trying to avoid. Also,\n \u003e making cyborg queue and retry the event seems too much to ask,\n \u003e IMHO. Nova would have a hard time doing that, and I don\u0027t doubt\n \u003e cyborg would as well.\n \nAgreed.\n\n \u003e One option is to just have cyborg not freak out about the 422 when\n \u003e sending the event, since we know we\u0027re asking it to do the work\n \u003e early and it may complete before we\u0027re ready. A 404 means the\n \u003e instance doesn\u0027t exist or was deleted mid-flight. 422 means \"Cyborg\n \u003e won\" but that\u0027s not really a problem.\n\nYes, I could make the notification as a best effort in Cyborg -- try it once and not fail the binding itself if it fails. \n\nAre you saying this is the entire solution? In most cases (all cases with the fake driver, and many/most cases with real drivers), the notification will get lost. \n\nSecondly, to elaborate on the pseudocode:\n\n with self.virtapi.wait_for_instance_event(instance, arq_events,\n  deadline\u003dtimeout):\n  early_events \u003d check_for_binding_completed(instance, arq_events)\n  self.virtapi.exit_wait_early(early_events)\n\nthe following is closer to actual code:\n\n arq_events \u003d [(\u0027accelerator-requests-bound\u0027, dp_name)]\n with self.wait_for_instance_event(instance, arq_events, deadline\u003dtimeout):\n   arqs \u003d get_arqs_if_binding_completed(instance) # returns None if incomplete\n   if arqs:   \n      self.exit_wait_early(arq_events)\n # Now that the wait is over, get arqs if needed\n if not arqs:\n    arqs \u003d get_arqs(instance)\n resources[\u0027accelerator_requests\u0027] \u003d arqs # similar to network_info, bdm","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"005c6afe13ea05f57970210165cad3f08f885292","unresolved":false,"context_lines":[{"line_number":2624,"context_line":"            arq_events \u003d []"},{"line_number":2625,"context_line":""},{"line_number":2626,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2627,"context_line":"            instance, arq_events, deadline\u003dtimeout):"},{"line_number":2628,"context_line":"            # This will prepare non-accelerator resources while"},{"line_number":2629,"context_line":"            # waiting for the Cyborg ARQ bound event. The actual"},{"line_number":2630,"context_line":"            # query to get bound ARQs happens in the virt driver\u0027s"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_cc61bc3a","line":2627,"in_reply_to":"3fa7e38b_96d0b1ca","updated":"2019-12-02 16:43:22.000000000","message":"\u003e One option is to just have cyborg not freak out about the 422 when\n \u003e sending the event, since we know we\u0027re asking it to do the work\n \u003e early and it may complete before we\u0027re ready. A 404 means the\n \u003e instance doesn\u0027t exist or was deleted mid-flight. 422 means \"Cyborg\n \u003e won\" but that\u0027s not really a problem.\n\nOh, yeah, that makes sense. If the 422 happens, the binding is done, so our shiny new exit_wait_early check will trigger and we won\u0027t wait for the (nonexistent) event in the first place.\n\nI can\u0027t think of a timing sequence that would break this. So ++.","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d832144a0ad3b62c21a94672ec8a43da0ff0fb83","unresolved":false,"context_lines":[{"line_number":2624,"context_line":"            arq_events \u003d []"},{"line_number":2625,"context_line":""},{"line_number":2626,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2627,"context_line":"            instance, arq_events, deadline\u003dtimeout):"},{"line_number":2628,"context_line":"            # This will prepare non-accelerator resources while"},{"line_number":2629,"context_line":"            # waiting for the Cyborg ARQ bound event. The actual"},{"line_number":2630,"context_line":"            # query to get bound ARQs happens in the virt driver\u0027s"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_626bef85","line":2627,"in_reply_to":"3fa7e38b_a75b3984","updated":"2019-12-02 18:12:16.000000000","message":"\u003e The point is, that\u0027s what we want. The \"lost\" events are among the\n \u003e ones that will be canceled via exit_wait_early.\n \nYes.\n\n \u003e For completeness, there are three good paths. When binding\n \u003e completes...\n \u003e \n \u003e 1) ...before the instance lands on the compute: The event is\n \u003e rejected with 422. We enter wait_for_instance_event and query\n \u003e cyborg, which tells us the binding is complete, so we\n \u003e exit_wait_early.\n \u003e \n \u003e 2) ...after the instance lands on compute, but before we enter\n \u003e wait_for_instance_event: The event is accepted and sent to the\n \u003e compute, which ignores it. We enter wait_for_instance_event and\n \u003e query cyborg, which tells us the binding is complete, so we\n \u003e exit_wait_early.\n \u003e \n \u003e 3) ...after we enter wait_for_instance_event: We queried cyborg and\n \u003e found the binding was *not* complete, so we didn\u0027t exit_wait_early.\n \u003e Once the binding completes, the event is emitted and\n \u003e wait_for_instance_event exits.\n\nThis ^","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d974c04cb809b59da4b8dcdb0e17f17a25cd5b38","unresolved":false,"context_lines":[{"line_number":2624,"context_line":"            arq_events \u003d []"},{"line_number":2625,"context_line":""},{"line_number":2626,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2627,"context_line":"            instance, arq_events, deadline\u003dtimeout):"},{"line_number":2628,"context_line":"            # This will prepare non-accelerator resources while"},{"line_number":2629,"context_line":"            # waiting for the Cyborg ARQ bound event. The actual"},{"line_number":2630,"context_line":"            # query to get bound ARQs happens in the virt driver\u0027s"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_6131b459","line":2627,"in_reply_to":"3fa7e38b_bd6fe591","updated":"2019-12-02 14:16:15.000000000","message":"\u003e Pretty sure the virtapi is a property on the ComputeDriver.\n\nConfirmed, self.virtapi. Here\u0027s a precedent [1].\n\n \u003e When the bind is kicked off from the conductor, the Cyborg\n \u003e notification event may come soon, before the instance is associated\n \u003e with a host in the compute manager.\n\nWait, are you saying associating the instance with a host happens at compute, not conductor?\n\n[Later] Confirmed. _build_and_run_instance does instance_claim [2] which does _set_instance_host_and_node [3] which sets the host on the instance [4].\n\nBut the host is sent in the payload of the binding API; why does cyborg care whether the instance is associated with the host in nova\u0027s database?\n\n[Later later] Oh, I see, the error is coming from nova when the event is created, where the host is checked because [5], which makes sense.\n\nCan the cyborg side just retry on that 422 until the event is accepted?\n\n[1] https://opendev.org/openstack/nova/src/commit/56eac06561bc843dcf7497e8b7ac3027f62544c1/nova/virt/libvirt/driver.py#L6197-L6199\n[2] https://opendev.org/openstack/nova/src/commit/56eac06561bc843dcf7497e8b7ac3027f62544c1/nova/compute/manager.py#L2393\n[3] https://opendev.org/openstack/nova/src/commit/56eac06561bc843dcf7497e8b7ac3027f62544c1/nova/compute/resource_tracker.py#L170\n[4] https://opendev.org/openstack/nova/src/commit/56eac06561bc843dcf7497e8b7ac3027f62544c1/nova/compute/resource_tracker.py#L504\n[5] https://opendev.org/openstack/nova/src/commit/56eac06561bc843dcf7497e8b7ac3027f62544c1/nova/api/openstack/compute/server_external_events.py#L114-L116","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"1269ead9224f42fe2583e91e00e889e165509f53","unresolved":false,"context_lines":[{"line_number":2624,"context_line":"            arq_events \u003d []"},{"line_number":2625,"context_line":""},{"line_number":2626,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2627,"context_line":"            instance, arq_events, deadline\u003dtimeout):"},{"line_number":2628,"context_line":"            # This will prepare non-accelerator resources while"},{"line_number":2629,"context_line":"            # waiting for the Cyborg ARQ bound event. The actual"},{"line_number":2630,"context_line":"            # query to get bound ARQs happens in the virt driver\u0027s"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_49b953c9","line":2627,"in_reply_to":"3fa7e38b_bd6fe591","updated":"2019-11-29 11:49:27.000000000","message":"right i was about to say https://github.com/openstack/nova/blob/master/nova/virt/virtapi.py defines a set of compute manager function that the driver can invoke.\n\nwe will need to extend that with the new method but that will allow you to use the function with out doing an import.","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"4522381f4e9bb180461ec6fd77b8aed8863d52d4","unresolved":false,"context_lines":[{"line_number":2624,"context_line":"            arq_events \u003d []"},{"line_number":2625,"context_line":""},{"line_number":2626,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2627,"context_line":"            instance, arq_events, deadline\u003dtimeout):"},{"line_number":2628,"context_line":"            # This will prepare non-accelerator resources while"},{"line_number":2629,"context_line":"            # waiting for the Cyborg ARQ bound event. The actual"},{"line_number":2630,"context_line":"            # query to get bound ARQs happens in the virt driver\u0027s"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_3a753b01","line":2627,"in_reply_to":"3fa7e38b_e49def58","updated":"2019-11-29 00:32:43.000000000","message":"\u003e kick off the process from conductor like we originally discussed. \n\nWhen the bind is kicked off from the conductor, the Cyborg notification event may come soon, before the instance is associated with a host in the compute manager. So, the Nova os-server-external-events API errors it out with:\n\n    DEBUG nova.api.openstack.compute.server_external_events [None req-183625a1-3b0e-4db5-b953-f99440bfa9f9 service nova] \n    Unable to find a host for instance 09f83fbd-0928-40f3-9e59-7348e1883cec. Dropping event accelerator-requests-bound\n\nToday Cyborg responds to this failure from Nova notification API by failing the binding. With a local change that logs the error instead of failing the binding, I could get a VM to spawn. But this is probably not the ideal way to fix this.\n\n \u003e I would recommend that we move that from build_resources where you\n \u003e have it here to be closer to the actual spawn (or perhaps in the\n \u003e virt driver to get overlap with the image download).\n\nFor the virt driver to access ComputeVirtAPI.exit_wait_early, it should import that from compute manager. I don\u0027t see any precedent of virt driver importing from compute manager, and it may have module dependency issues. Is that kosher?","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"187cd4aee297cbde13ca0e5c2b069da990f39813","unresolved":false,"context_lines":[{"line_number":2628,"context_line":"            # This will prepare non-accelerator resources while"},{"line_number":2629,"context_line":"            # waiting for the Cyborg ARQ bound event. The actual"},{"line_number":2630,"context_line":"            # query to get bound ARQs happens in the virt driver\u0027s"},{"line_number":2631,"context_line":"            # spawn() method."},{"line_number":2632,"context_line":"            # If dp_name \u003d None, this call is a nop."},{"line_number":2633,"context_line":"            self._create_and_bind_arqs(context, dp_name, instance.uuid,"},{"line_number":2634,"context_line":"                                       instance.host,"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_7961ba38","line":2631,"updated":"2019-11-25 19:27:39.000000000","message":"This is creating non-accelerator resources? Why would we need a complex async post-and-wait-for-event mechanism for that? Isn\u0027t the binding something that could happen synchronously, along with the other things going on here like preparing networks and block devices?","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"b4e8f1867465e95641ed5378b70055bc4a84bb2b","unresolved":false,"context_lines":[{"line_number":2628,"context_line":"            # This will prepare non-accelerator resources while"},{"line_number":2629,"context_line":"            # waiting for the Cyborg ARQ bound event. The actual"},{"line_number":2630,"context_line":"            # query to get bound ARQs happens in the virt driver\u0027s"},{"line_number":2631,"context_line":"            # spawn() method."},{"line_number":2632,"context_line":"            # If dp_name \u003d None, this call is a nop."},{"line_number":2633,"context_line":"            self._create_and_bind_arqs(context, dp_name, instance.uuid,"},{"line_number":2634,"context_line":"                                       instance.host,"}],"source_content_type":"text/x-python","patch_set":46,"id":"3fa7e38b_c70195b7","line":2631,"in_reply_to":"3fa7e38b_7961ba38","updated":"2019-12-02 17:09:10.000000000","message":"What I\u0027m saying is, the _create_and_bind_arqs() in L2633 kicks off asynchronous bind; while that is going on, we are preparing non-accelerator resources (network_info, bdm stuff). Anyway, this part is going to change with the proposed exit_wait_early approach.","commit_id":"084e4e18192bfe48ac18693b32fa3c6fad61a3b6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b223f4d0583b0f4de2a6e7243b6c27636b35ae38","unresolved":false,"context_lines":[{"line_number":2723,"context_line":"            raise exception.BuildAbortException(instance_uuid\u003dinstance.uuid,"},{"line_number":2724,"context_line":"                    reason\u003dmsg)"},{"line_number":2725,"context_line":""},{"line_number":2726,"context_line":"        arqs \u003d None"},{"line_number":2727,"context_line":"        dp_name \u003d instance.flavor.extra_specs.get(\u0027accel:device_profile\u0027)"},{"line_number":2728,"context_line":"        try:"},{"line_number":2729,"context_line":"            if dp_name:"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_08fc790a","line":2726,"updated":"2019-12-04 15:08:51.000000000","message":"I think this should be arqs\u003d[] to be in keeping with the other two (BDMs and network_info).","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"14c3bb47bd071a2e4542f5530e7a25f25f235769","unresolved":false,"context_lines":[{"line_number":2723,"context_line":"            raise exception.BuildAbortException(instance_uuid\u003dinstance.uuid,"},{"line_number":2724,"context_line":"                    reason\u003dmsg)"},{"line_number":2725,"context_line":""},{"line_number":2726,"context_line":"        arqs \u003d None"},{"line_number":2727,"context_line":"        dp_name \u003d instance.flavor.extra_specs.get(\u0027accel:device_profile\u0027)"},{"line_number":2728,"context_line":"        try:"},{"line_number":2729,"context_line":"            if dp_name:"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_9675e635","line":2726,"in_reply_to":"3fa7e38b_08fc790a","updated":"2019-12-09 03:50:21.000000000","message":"Done","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b223f4d0583b0f4de2a6e7243b6c27636b35ae38","unresolved":false,"context_lines":[{"line_number":2790,"context_line":"        timeout \u003d CONF.arq_binding_timeout or None"},{"line_number":2791,"context_line":"        arq_events \u003d [(\u0027accelerator-requests-bound\u0027, dp_name)]"},{"line_number":2792,"context_line":"        cyclient \u003d cyborg.get_client(context)"},{"line_number":2793,"context_line":"        LOG.info(\u0027Waiting till accelerator requests are bound for \u0027"},{"line_number":2794,"context_line":"                 \u0027instance %s\u0027, instance.uuid)"},{"line_number":2795,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2796,"context_line":"                instance, arq_events, deadline\u003dtimeout):"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_a80a051b","line":2793,"range":{"start_line":2793,"start_character":26,"end_line":2793,"end_character":30},"updated":"2019-12-04 15:08:51.000000000","message":"until.\n\nAlso, if you want to make this correct, you really should put this before the context falls through below (i.e. L2802, inside the context). Otherwise you\u0027ll log \"waiting...\" when you\u0027re actually just going to skip immediately.","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"14c3bb47bd071a2e4542f5530e7a25f25f235769","unresolved":false,"context_lines":[{"line_number":2790,"context_line":"        timeout \u003d CONF.arq_binding_timeout or None"},{"line_number":2791,"context_line":"        arq_events \u003d [(\u0027accelerator-requests-bound\u0027, dp_name)]"},{"line_number":2792,"context_line":"        cyclient \u003d cyborg.get_client(context)"},{"line_number":2793,"context_line":"        LOG.info(\u0027Waiting till accelerator requests are bound for \u0027"},{"line_number":2794,"context_line":"                 \u0027instance %s\u0027, instance.uuid)"},{"line_number":2795,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2796,"context_line":"                instance, arq_events, deadline\u003dtimeout):"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_b66902f9","line":2793,"range":{"start_line":2793,"start_character":26,"end_line":2793,"end_character":30},"in_reply_to":"3fa7e38b_a80a051b","updated":"2019-12-09 03:50:21.000000000","message":"\u003e until.\n\nMost sources say that they are equivalent [1] [2] [3]. But I\u0027ll change it anyway.\n\n[1] https://www.grammarly.com/blog/until-till-til/\n[2] https://www.merriam-webster.com/words-at-play/should-you-use-until-or-till-or-til\n[3] https://english.stackexchange.com/questions/6989/what-is-the-difference-between-till-and-until\n\n \u003e Also, if you want to make this correct, you really should put this\n \u003e before the context falls through below (i.e. L2802, inside the\n \u003e context). Otherwise you\u0027ll log \"waiting...\" when you\u0027re actually\n \u003e just going to skip immediately.\n\nWell, in that case, it is a short wait. :) But ... done.","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b9972f9e44c4ff32a1eaa41c659fe11aa310b92a","unresolved":false,"context_lines":[{"line_number":2790,"context_line":"        timeout \u003d CONF.arq_binding_timeout or None"},{"line_number":2791,"context_line":"        arq_events \u003d [(\u0027accelerator-requests-bound\u0027, dp_name)]"},{"line_number":2792,"context_line":"        cyclient \u003d cyborg.get_client(context)"},{"line_number":2793,"context_line":"        LOG.info(\u0027Waiting till accelerator requests are bound for \u0027"},{"line_number":2794,"context_line":"                 \u0027instance %s\u0027, instance.uuid)"},{"line_number":2795,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2796,"context_line":"                instance, arq_events, deadline\u003dtimeout):"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_04cbc749","line":2793,"range":{"start_line":2793,"start_character":26,"end_line":2793,"end_character":30},"in_reply_to":"3fa7e38b_b66902f9","updated":"2019-12-09 15:33:10.000000000","message":"\u003e \u003e until.\n \u003e \n \u003e Most sources say that they are equivalent [1] [2] [3]. But I\u0027ll\n \u003e change it anyway.\n\nIt\u0027s shortened slang, and it\u0027s confusing, and \"till\" is also an english word meaning something else.","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b223f4d0583b0f4de2a6e7243b6c27636b35ae38","unresolved":false,"context_lines":[{"line_number":2800,"context_line":"            if arqs:"},{"line_number":2801,"context_line":"                self.virtapi.exit_wait_early(arq_events)"},{"line_number":2802,"context_line":"        LOG.info(\u0027Stopped waiting to bind accelerator requests for \u0027"},{"line_number":2803,"context_line":"                 \u0027instance %s\u0027, instance.uuid)"},{"line_number":2804,"context_line":""},{"line_number":2805,"context_line":"        if not arqs:"},{"line_number":2806,"context_line":"            # Now that the wait is complete, we try again to get ARQs."}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_4847d14d","line":2803,"updated":"2019-12-04 15:08:51.000000000","message":"I think you can remove this. If you log the waiting thing, we can see the event actually come in because of the general plumbing. I think all of this is probably debug-level, and adding something inside the \"if arqs: skip\" conditional for symmetry would be good.","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"14c3bb47bd071a2e4542f5530e7a25f25f235769","unresolved":false,"context_lines":[{"line_number":2800,"context_line":"            if arqs:"},{"line_number":2801,"context_line":"                self.virtapi.exit_wait_early(arq_events)"},{"line_number":2802,"context_line":"        LOG.info(\u0027Stopped waiting to bind accelerator requests for \u0027"},{"line_number":2803,"context_line":"                 \u0027instance %s\u0027, instance.uuid)"},{"line_number":2804,"context_line":""},{"line_number":2805,"context_line":"        if not arqs:"},{"line_number":2806,"context_line":"            # Now that the wait is complete, we try again to get ARQs."}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_77535d3b","line":2803,"in_reply_to":"3fa7e38b_4847d14d","updated":"2019-12-09 03:50:21.000000000","message":"The logs that the event arrived are in n-api, not n-cpu AFAICS. Even there, it is usually an error log like:\n\n  Unable to find a host for instance 4dfc1bee\n\nBut I did demote this to a LOG.debug.","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b223f4d0583b0f4de2a6e7243b6c27636b35ae38","unresolved":false,"context_lines":[{"line_number":2809,"context_line":"            if not arqs:"},{"line_number":2810,"context_line":"                err \u003d (\u0027Failed to get bound accelerator requests for\u0027"},{"line_number":2811,"context_line":"                       \u0027instance %s\u0027 % instance.uuid)"},{"line_number":2812,"context_line":"                LOG.error(err)"},{"line_number":2813,"context_line":"                msg \u003d _(\u0027instance %s\u0027) % instance.uuid"},{"line_number":2814,"context_line":"                raise exception.AcceleratorRequestOpFailed("},{"line_number":2815,"context_line":"                    op\u003d_(\u0027get bound accelerator requests\u0027), msg\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_e86f9dc1","line":2812,"updated":"2019-12-04 15:08:51.000000000","message":"I don\u0027t think this is necessary because we\u0027ll log the exception you\u0027re raising, right?","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"14c3bb47bd071a2e4542f5530e7a25f25f235769","unresolved":false,"context_lines":[{"line_number":2809,"context_line":"            if not arqs:"},{"line_number":2810,"context_line":"                err \u003d (\u0027Failed to get bound accelerator requests for\u0027"},{"line_number":2811,"context_line":"                       \u0027instance %s\u0027 % instance.uuid)"},{"line_number":2812,"context_line":"                LOG.error(err)"},{"line_number":2813,"context_line":"                msg \u003d _(\u0027instance %s\u0027) % instance.uuid"},{"line_number":2814,"context_line":"                raise exception.AcceleratorRequestOpFailed("},{"line_number":2815,"context_line":"                    op\u003d_(\u0027get bound accelerator requests\u0027), msg\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_3c9f0c66","line":2812,"in_reply_to":"3fa7e38b_e86f9dc1","updated":"2019-12-09 03:50:21.000000000","message":"Done","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b223f4d0583b0f4de2a6e7243b6c27636b35ae38","unresolved":false,"context_lines":[{"line_number":2813,"context_line":"                msg \u003d _(\u0027instance %s\u0027) % instance.uuid"},{"line_number":2814,"context_line":"                raise exception.AcceleratorRequestOpFailed("},{"line_number":2815,"context_line":"                    op\u003d_(\u0027get bound accelerator requests\u0027), msg\u003dmsg)"},{"line_number":2816,"context_line":"        LOG.info(\u0027Got ARQs %s\u0027, arqs)"},{"line_number":2817,"context_line":"        return arqs"},{"line_number":2818,"context_line":""},{"line_number":2819,"context_line":"    def _cleanup_allocated_networks(self, context, instance,"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_0898f9c9","line":2816,"updated":"2019-12-04 15:08:51.000000000","message":"This seems superfluous, but definitely not appropriate for info level","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"14c3bb47bd071a2e4542f5530e7a25f25f235769","unresolved":false,"context_lines":[{"line_number":2813,"context_line":"                msg \u003d _(\u0027instance %s\u0027) % instance.uuid"},{"line_number":2814,"context_line":"                raise exception.AcceleratorRequestOpFailed("},{"line_number":2815,"context_line":"                    op\u003d_(\u0027get bound accelerator requests\u0027), msg\u003dmsg)"},{"line_number":2816,"context_line":"        LOG.info(\u0027Got ARQs %s\u0027, arqs)"},{"line_number":2817,"context_line":"        return arqs"},{"line_number":2818,"context_line":""},{"line_number":2819,"context_line":"    def _cleanup_allocated_networks(self, context, instance,"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_17d2505c","line":2816,"in_reply_to":"3fa7e38b_0898f9c9","updated":"2019-12-09 03:50:21.000000000","message":"Done","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b9972f9e44c4ff32a1eaa41c659fe11aa310b92a","unresolved":false,"context_lines":[{"line_number":2729,"context_line":"            if dp_name:"},{"line_number":2730,"context_line":"                arqs \u003d self._get_bound_arq_resources("},{"line_number":2731,"context_line":"                        context, dp_name, instance)"},{"line_number":2732,"context_line":"        except exception.AcceleratorRequestOpFailed as exc:"},{"line_number":2733,"context_line":"            LOG.exception(exc.format_message())"},{"line_number":2734,"context_line":"            if network_info is not None:"},{"line_number":2735,"context_line":"                network_info.wait(do_raise\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":49,"id":"3fa7e38b_64bb9b74","line":2732,"updated":"2019-12-09 15:33:10.000000000","message":"Don\u0027t you need to account for the timeout exception and clean up all the network/block stuff from above? And a diaper exception handler case like the above have as well.","commit_id":"990c94178badd0b5cd01ab419c82ae92e5cb4150"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"1026191d67091f8a5b1e7532cf13662749113809","unresolved":false,"context_lines":[{"line_number":2729,"context_line":"            if dp_name:"},{"line_number":2730,"context_line":"                arqs \u003d self._get_bound_arq_resources("},{"line_number":2731,"context_line":"                        context, dp_name, instance)"},{"line_number":2732,"context_line":"        except exception.AcceleratorRequestOpFailed as exc:"},{"line_number":2733,"context_line":"            LOG.exception(exc.format_message())"},{"line_number":2734,"context_line":"            if network_info is not None:"},{"line_number":2735,"context_line":"                network_info.wait(do_raise\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":49,"id":"3fa7e38b_7707afca","line":2732,"in_reply_to":"3fa7e38b_64bb9b74","updated":"2019-12-11 19:56:10.000000000","message":"Done","commit_id":"990c94178badd0b5cd01ab419c82ae92e5cb4150"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b9972f9e44c4ff32a1eaa41c659fe11aa310b92a","unresolved":false,"context_lines":[{"line_number":2796,"context_line":"            # Returns None if binding is still in progress"},{"line_number":2797,"context_line":"            arqs \u003d cyclient.get_resolved_arqs_for_instance("},{"line_number":2798,"context_line":"                    instance.uuid)"},{"line_number":2799,"context_line":"            if arqs:"},{"line_number":2800,"context_line":"                self.virtapi.exit_wait_early(arq_events)"},{"line_number":2801,"context_line":"            LOG.debug(\u0027Waiting until accelerator requests are bound for \u0027"},{"line_number":2802,"context_line":"                     \u0027instance %s\u0027, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":49,"id":"3fa7e38b_449d3f07","line":2799,"updated":"2019-12-09 15:33:10.000000000","message":"This is only correct if we have one ARQ for the instance, right? Couldn\u0027t we have more (eventually), where one resolved immediately and the others did not? You need to either assert that there is only one, or filter the list that we\u0027re actually going to wait for and early-exit for the ones that have already come in.","commit_id":"990c94178badd0b5cd01ab419c82ae92e5cb4150"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"599db8f2f93c18eb10112ec15e91a39441701a37","unresolved":false,"context_lines":[{"line_number":2796,"context_line":"            # Returns None if binding is still in progress"},{"line_number":2797,"context_line":"            arqs \u003d cyclient.get_resolved_arqs_for_instance("},{"line_number":2798,"context_line":"                    instance.uuid)"},{"line_number":2799,"context_line":"            if arqs:"},{"line_number":2800,"context_line":"                self.virtapi.exit_wait_early(arq_events)"},{"line_number":2801,"context_line":"            LOG.debug(\u0027Waiting until accelerator requests are bound for \u0027"},{"line_number":2802,"context_line":"                     \u0027instance %s\u0027, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":49,"id":"3fa7e38b_090414c5","line":2799,"in_reply_to":"3fa7e38b_0983b457","updated":"2019-12-13 05:43:11.000000000","message":"Each instance has a single device profile. A device profile has multiple request groups, each of which may request multiple resources (and this multiple ARQs). Please see:\nhttps://review.opendev.org/#/c/631243/46/nova/accelerator/cyborg.py@26\n\nThis whole code segment is changing per IRC discussion.","commit_id":"990c94178badd0b5cd01ab419c82ae92e5cb4150"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"c6dfd721da3bf0ff82d67bab94c1d583fb7be40a","unresolved":false,"context_lines":[{"line_number":2796,"context_line":"            # Returns None if binding is still in progress"},{"line_number":2797,"context_line":"            arqs \u003d cyclient.get_resolved_arqs_for_instance("},{"line_number":2798,"context_line":"                    instance.uuid)"},{"line_number":2799,"context_line":"            if arqs:"},{"line_number":2800,"context_line":"                self.virtapi.exit_wait_early(arq_events)"},{"line_number":2801,"context_line":"            LOG.debug(\u0027Waiting until accelerator requests are bound for \u0027"},{"line_number":2802,"context_line":"                     \u0027instance %s\u0027, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":49,"id":"3fa7e38b_c91cbc67","line":2799,"in_reply_to":"3fa7e38b_2e331615","updated":"2019-12-11 20:42:17.000000000","message":"Yes, Cyborg sends one notification per instance (for all its ARQs), when all of those ARQs for that instance have completed binding (successfully or otherwise). If all completed successfully, the event notification status for the instance is \u0027completed\u0027; if one or more have failed, the status is failure.\n\nThat is designed to forestall exactly this type of complication.","commit_id":"990c94178badd0b5cd01ab419c82ae92e5cb4150"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"1026191d67091f8a5b1e7532cf13662749113809","unresolved":false,"context_lines":[{"line_number":2796,"context_line":"            # Returns None if binding is still in progress"},{"line_number":2797,"context_line":"            arqs \u003d cyclient.get_resolved_arqs_for_instance("},{"line_number":2798,"context_line":"                    instance.uuid)"},{"line_number":2799,"context_line":"            if arqs:"},{"line_number":2800,"context_line":"                self.virtapi.exit_wait_early(arq_events)"},{"line_number":2801,"context_line":"            LOG.debug(\u0027Waiting until accelerator requests are bound for \u0027"},{"line_number":2802,"context_line":"                     \u0027instance %s\u0027, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":49,"id":"3fa7e38b_b7f8c7c0","line":2799,"in_reply_to":"3fa7e38b_449d3f07","updated":"2019-12-11 19:56:10.000000000","message":"If one or more ARQs are still going through binding, Cyborg returns HTTP 423 and get_resolved_arqs_...() returns None [1]. IOW, this code needs to handle only all-are-resolved (arqs !\u003d None) or some-are-still-unresolved (arqs \u003d\u003d None).\n\n[1] https://review.opendev.org/#/c/631244/49/nova/accelerator/cyborg.py@198","commit_id":"990c94178badd0b5cd01ab419c82ae92e5cb4150"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d064ddc66377ea822fc9ccc0a8926de12dfc759b","unresolved":false,"context_lines":[{"line_number":2796,"context_line":"            # Returns None if binding is still in progress"},{"line_number":2797,"context_line":"            arqs \u003d cyclient.get_resolved_arqs_for_instance("},{"line_number":2798,"context_line":"                    instance.uuid)"},{"line_number":2799,"context_line":"            if arqs:"},{"line_number":2800,"context_line":"                self.virtapi.exit_wait_early(arq_events)"},{"line_number":2801,"context_line":"            LOG.debug(\u0027Waiting until accelerator requests are bound for \u0027"},{"line_number":2802,"context_line":"                     \u0027instance %s\u0027, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":49,"id":"3fa7e38b_2e331615","line":2799,"in_reply_to":"3fa7e38b_b7f8c7c0","updated":"2019-12-11 20:31:53.000000000","message":"\u003e If one or more ARQs are still going through binding, Cyborg returns\n \u003e HTTP 423 and get_resolved_arqs_...() returns None [1].\n\nWell, then that needs to change, right? If any of the events have been delivered, you *have* to skip them. If any have not, you must *not* skip those.\n\n \u003e IOW, this\n \u003e code needs to handle only all-are-resolved (arqs !\u003d None) or\n \u003e some-are-still-unresolved (arqs \u003d\u003d None).\n\nUnless cyborg sends one and only one notification per *instance* then I do not agree with this assertion.","commit_id":"990c94178badd0b5cd01ab419c82ae92e5cb4150"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"467de1316b83ce926c7d625c1dad8d940fc0a6a8","unresolved":false,"context_lines":[{"line_number":2796,"context_line":"            # Returns None if binding is still in progress"},{"line_number":2797,"context_line":"            arqs \u003d cyclient.get_resolved_arqs_for_instance("},{"line_number":2798,"context_line":"                    instance.uuid)"},{"line_number":2799,"context_line":"            if arqs:"},{"line_number":2800,"context_line":"                self.virtapi.exit_wait_early(arq_events)"},{"line_number":2801,"context_line":"            LOG.debug(\u0027Waiting until accelerator requests are bound for \u0027"},{"line_number":2802,"context_line":"                     \u0027instance %s\u0027, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":49,"id":"3fa7e38b_0983b457","line":2799,"in_reply_to":"3fa7e38b_c91cbc67","updated":"2019-12-11 20:49:20.000000000","message":"So if I have two devices, each with different profiles, which profile is in the event? Sounds like we need to NAK the eventing patch for the use of device profile as a tag, if it\u0027s one event per instance and the tag is meaningless.\n\n(hint: it shouldn\u0027t be meaningless and you should send one event per device just like the other users of that service).","commit_id":"990c94178badd0b5cd01ab419c82ae92e5cb4150"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1bdb26e35f7e07b402850923634dc9c7dc0bcb16","unresolved":false,"context_lines":[{"line_number":2799,"context_line":"            if arqs:"},{"line_number":2800,"context_line":"                self.virtapi.exit_wait_early(arq_events)"},{"line_number":2801,"context_line":"            LOG.debug(\u0027Waiting until accelerator requests are bound for \u0027"},{"line_number":2802,"context_line":"                     \u0027instance %s\u0027, instance.uuid)"},{"line_number":2803,"context_line":"        LOG.debug(\u0027Stopped waiting to bind accelerator requests for \u0027"},{"line_number":2804,"context_line":"                 \u0027instance %s\u0027, instance.uuid)"},{"line_number":2805,"context_line":""}],"source_content_type":"text/x-python","patch_set":49,"id":"3fa7e38b_44445f73","line":2802,"updated":"2019-12-09 15:37:53.000000000","message":"If you exit early for only some ARQs, then you will never log this message, but you will still wait. That ambiguity will make debugging super hard. This should be either removed or moved above L2799.","commit_id":"990c94178badd0b5cd01ab419c82ae92e5cb4150"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"1026191d67091f8a5b1e7532cf13662749113809","unresolved":false,"context_lines":[{"line_number":2799,"context_line":"            if arqs:"},{"line_number":2800,"context_line":"                self.virtapi.exit_wait_early(arq_events)"},{"line_number":2801,"context_line":"            LOG.debug(\u0027Waiting until accelerator requests are bound for \u0027"},{"line_number":2802,"context_line":"                     \u0027instance %s\u0027, instance.uuid)"},{"line_number":2803,"context_line":"        LOG.debug(\u0027Stopped waiting to bind accelerator requests for \u0027"},{"line_number":2804,"context_line":"                 \u0027instance %s\u0027, instance.uuid)"},{"line_number":2805,"context_line":""}],"source_content_type":"text/x-python","patch_set":49,"id":"3fa7e38b_77300f9f","line":2802,"in_reply_to":"3fa7e38b_44445f73","updated":"2019-12-11 19:56:10.000000000","message":"Please see above -- we will never handle a partial set of ARQs for an instance.","commit_id":"990c94178badd0b5cd01ab419c82ae92e5cb4150"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"599db8f2f93c18eb10112ec15e91a39441701a37","unresolved":false,"context_lines":[{"line_number":2799,"context_line":"            if arqs:"},{"line_number":2800,"context_line":"                self.virtapi.exit_wait_early(arq_events)"},{"line_number":2801,"context_line":"            LOG.debug(\u0027Waiting until accelerator requests are bound for \u0027"},{"line_number":2802,"context_line":"                     \u0027instance %s\u0027, instance.uuid)"},{"line_number":2803,"context_line":"        LOG.debug(\u0027Stopped waiting to bind accelerator requests for \u0027"},{"line_number":2804,"context_line":"                 \u0027instance %s\u0027, instance.uuid)"},{"line_number":2805,"context_line":""}],"source_content_type":"text/x-python","patch_set":49,"id":"3fa7e38b_5bb079fd","line":2802,"in_reply_to":"3fa7e38b_77300f9f","updated":"2019-12-13 05:43:11.000000000","message":"Changing this log in the next patchset.","commit_id":"990c94178badd0b5cd01ab419c82ae92e5cb4150"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b9972f9e44c4ff32a1eaa41c659fe11aa310b92a","unresolved":false,"context_lines":[{"line_number":2801,"context_line":"            LOG.debug(\u0027Waiting until accelerator requests are bound for \u0027"},{"line_number":2802,"context_line":"                     \u0027instance %s\u0027, instance.uuid)"},{"line_number":2803,"context_line":"        LOG.debug(\u0027Stopped waiting to bind accelerator requests for \u0027"},{"line_number":2804,"context_line":"                 \u0027instance %s\u0027, instance.uuid)"},{"line_number":2805,"context_line":""},{"line_number":2806,"context_line":"        if not arqs:"},{"line_number":2807,"context_line":"            # Now that the wait is complete, we try again to get ARQs."}],"source_content_type":"text/x-python","patch_set":49,"id":"3fa7e38b_04d507b7","line":2804,"updated":"2019-12-09 15:33:10.000000000","message":"Please remove this. You will pepper the logs with \"Stopped waiting\" regardless of if we actually waited. And that will always come right after we *always* log the event itself here:\n\nhttps://github.com/openstack/nova/blob/56d3cd7aa7f4d3be01fd2a5c10903fb548c49458/nova/compute/manager.py#L9751\n\n..yes, in the compute manager.","commit_id":"990c94178badd0b5cd01ab419c82ae92e5cb4150"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"1026191d67091f8a5b1e7532cf13662749113809","unresolved":false,"context_lines":[{"line_number":2801,"context_line":"            LOG.debug(\u0027Waiting until accelerator requests are bound for \u0027"},{"line_number":2802,"context_line":"                     \u0027instance %s\u0027, instance.uuid)"},{"line_number":2803,"context_line":"        LOG.debug(\u0027Stopped waiting to bind accelerator requests for \u0027"},{"line_number":2804,"context_line":"                 \u0027instance %s\u0027, instance.uuid)"},{"line_number":2805,"context_line":""},{"line_number":2806,"context_line":"        if not arqs:"},{"line_number":2807,"context_line":"            # Now that the wait is complete, we try again to get ARQs."}],"source_content_type":"text/x-python","patch_set":49,"id":"3fa7e38b_37261769","line":2804,"in_reply_to":"3fa7e38b_04d507b7","updated":"2019-12-11 19:56:10.000000000","message":"Done","commit_id":"990c94178badd0b5cd01ab419c82ae92e5cb4150"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1bdb26e35f7e07b402850923634dc9c7dc0bcb16","unresolved":false,"context_lines":[{"line_number":2811,"context_line":"                msg \u003d _(\u0027Binding failed. instance %s\u0027) % instance.uuid"},{"line_number":2812,"context_line":"                raise exception.AcceleratorRequestOpFailed("},{"line_number":2813,"context_line":"                    op\u003d_(\u0027get\u0027), msg\u003dmsg)"},{"line_number":2814,"context_line":"        LOG.debug(\u0027Got ARQs %s\u0027, arqs)"},{"line_number":2815,"context_line":"        return arqs"},{"line_number":2816,"context_line":""},{"line_number":2817,"context_line":"    def _cleanup_allocated_networks(self, context, instance,"}],"source_content_type":"text/x-python","patch_set":49,"id":"3fa7e38b_045ae74e","line":2814,"updated":"2019-12-09 15:37:53.000000000","message":"I still think this is too verbose even at debug level.","commit_id":"990c94178badd0b5cd01ab419c82ae92e5cb4150"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"1026191d67091f8a5b1e7532cf13662749113809","unresolved":false,"context_lines":[{"line_number":2811,"context_line":"                msg \u003d _(\u0027Binding failed. instance %s\u0027) % instance.uuid"},{"line_number":2812,"context_line":"                raise exception.AcceleratorRequestOpFailed("},{"line_number":2813,"context_line":"                    op\u003d_(\u0027get\u0027), msg\u003dmsg)"},{"line_number":2814,"context_line":"        LOG.debug(\u0027Got ARQs %s\u0027, arqs)"},{"line_number":2815,"context_line":"        return arqs"},{"line_number":2816,"context_line":""},{"line_number":2817,"context_line":"    def _cleanup_allocated_networks(self, context, instance,"}],"source_content_type":"text/x-python","patch_set":49,"id":"3fa7e38b_f71b9f18","line":2814,"in_reply_to":"3fa7e38b_045ae74e","updated":"2019-12-11 19:56:10.000000000","message":"Done","commit_id":"990c94178badd0b5cd01ab419c82ae92e5cb4150"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0cf8b5dba70bacb4db2923a8b8725e79f74373f6","unresolved":false,"context_lines":[{"line_number":2781,"context_line":"            If Cyborg call fails or returns no ARQs"},{"line_number":2782,"context_line":"        \"\"\""},{"line_number":2783,"context_line":"        timeout \u003d CONF.arq_binding_timeout or None"},{"line_number":2784,"context_line":"        arq_events \u003d [(\u0027accelerator-requests-bound\u0027, dp_name)]"},{"line_number":2785,"context_line":"        cyclient \u003d cyborg.get_client(context)"},{"line_number":2786,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2787,"context_line":"                instance, arq_events, deadline\u003dtimeout):"}],"source_content_type":"text/x-python","patch_set":51,"id":"3fa7e38b_6494cd41","line":2784,"updated":"2019-12-11 22:38:55.000000000","message":"Per discussion in IRC, this should be one event per ARQ, and we either poll cyborg once for all ARQs prior to this wait, or we pass them down from conductor since it has them anyway.","commit_id":"14f3a38db4998d07fd511178956361fec45f8605"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"599db8f2f93c18eb10112ec15e91a39441701a37","unresolved":false,"context_lines":[{"line_number":2781,"context_line":"            If Cyborg call fails or returns no ARQs"},{"line_number":2782,"context_line":"        \"\"\""},{"line_number":2783,"context_line":"        timeout \u003d CONF.arq_binding_timeout or None"},{"line_number":2784,"context_line":"        arq_events \u003d [(\u0027accelerator-requests-bound\u0027, dp_name)]"},{"line_number":2785,"context_line":"        cyclient \u003d cyborg.get_client(context)"},{"line_number":2786,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2787,"context_line":"                instance, arq_events, deadline\u003dtimeout):"}],"source_content_type":"text/x-python","patch_set":51,"id":"3fa7e38b_5b0959d9","line":2784,"in_reply_to":"3fa7e38b_6494cd41","updated":"2019-12-13 05:43:11.000000000","message":"Done. For the next patchset, I\u0027ll poll cyborg prior to the wait. We can take it from there.","commit_id":"14f3a38db4998d07fd511178956361fec45f8605"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f0beb71139e4ee670396bbe2b0738b2fa6dff434","unresolved":false,"context_lines":[{"line_number":2788,"context_line":"            # Returns None if binding is still in progress"},{"line_number":2789,"context_line":"            arqs \u003d cyclient.get_resolved_arqs_for_instance("},{"line_number":2790,"context_line":"                    instance.uuid)"},{"line_number":2791,"context_line":"            if arqs:"},{"line_number":2792,"context_line":"                self.virtapi.exit_wait_early(arq_events)"},{"line_number":2793,"context_line":"            LOG.debug(\u0027Waiting until accelerator requests are bound for \u0027"},{"line_number":2794,"context_line":"                     \u0027instance %s\u0027, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":51,"id":"3fa7e38b_69126857","line":2791,"range":{"start_line":2791,"start_character":12,"end_line":2791,"end_character":20},"updated":"2019-12-11 20:42:08.000000000","message":"It would help if you would respond to concerns before pushing a new set, either to convince reviewers that you\u0027re right, or let us convince you that you\u0027re wrong.\n\nSo, I\u0027m not going to review the other changes here until you respond to my reply from PS49.","commit_id":"14f3a38db4998d07fd511178956361fec45f8605"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"faa1d71ff475c4520ae46390e025c8e8c2106b9c","unresolved":false,"context_lines":[{"line_number":2675,"context_line":"            if dp_name:"},{"line_number":2676,"context_line":"                arqs \u003d self._get_bound_arq_resources("},{"line_number":2677,"context_line":"                        context, dp_name, instance)"},{"line_number":2678,"context_line":"        except (Exception, eventlet.timeout.Timeout) as exc:"},{"line_number":2679,"context_line":"            LOG.exception(exc.format_message())"},{"line_number":2680,"context_line":"            if network_info is not None:"},{"line_number":2681,"context_line":"                network_info.wait(do_raise\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_5bdd35dc","line":2678,"range":{"start_line":2678,"start_character":25,"end_line":2678,"end_character":51},"updated":"2020-01-02 16:53:44.000000000","message":"This is unnecessary right? Exception will catch everything.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"e454cb6639c09987c8947c61f09efcd8de39c641","unresolved":false,"context_lines":[{"line_number":2675,"context_line":"            if dp_name:"},{"line_number":2676,"context_line":"                arqs \u003d self._get_bound_arq_resources("},{"line_number":2677,"context_line":"                        context, dp_name, instance)"},{"line_number":2678,"context_line":"        except (Exception, eventlet.timeout.Timeout) as exc:"},{"line_number":2679,"context_line":"            LOG.exception(exc.format_message())"},{"line_number":2680,"context_line":"            if network_info is not None:"},{"line_number":2681,"context_line":"                network_info.wait(do_raise\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_d320befc","line":2678,"range":{"start_line":2678,"start_character":25,"end_line":2678,"end_character":51},"in_reply_to":"3fa7e38b_5bdd35dc","updated":"2020-01-15 07:04:59.000000000","message":"The Timeout is based on BaseException [1], which is not covered by Exception alone.\n\n[1] https://github.com/eventlet/eventlet/blob/master/eventlet/timeout.py#L38","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"59972f9bfeb33055cf27ccb66e1ec3ba050c9a65","unresolved":false,"context_lines":[{"line_number":2675,"context_line":"            if dp_name:"},{"line_number":2676,"context_line":"                arqs \u003d self._get_bound_arq_resources("},{"line_number":2677,"context_line":"                        context, dp_name, instance)"},{"line_number":2678,"context_line":"        except (Exception, eventlet.timeout.Timeout) as exc:"},{"line_number":2679,"context_line":"            LOG.exception(exc.format_message())"},{"line_number":2680,"context_line":"            if network_info is not None:"},{"line_number":2681,"context_line":"                network_info.wait(do_raise\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_21318bbc","line":2678,"range":{"start_line":2678,"start_character":25,"end_line":2678,"end_character":51},"in_reply_to":"3fa7e38b_d320befc","updated":"2020-01-15 14:52:27.000000000","message":"Dear god.\n\n...okay.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"faa1d71ff475c4520ae46390e025c8e8c2106b9c","unresolved":false,"context_lines":[{"line_number":2744,"context_line":"                    instance.uuid, only_resolved\u003dTrue)"},{"line_number":2745,"context_line":"            ignore_events \u003d [(\u0027accelerator-request-bound\u0027, arq[\u0027uuid\u0027])"},{"line_number":2746,"context_line":"                             for arq in resolved_arqs]"},{"line_number":2747,"context_line":"            self.virtapi.exit_wait_early(ignore_events)"},{"line_number":2748,"context_line":""},{"line_number":2749,"context_line":"        # Since a timeout in wait_for_instance_event will raise, we get"},{"line_number":2750,"context_line":"        # here only if all binding events have been received."}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_3b7b99f4","line":2747,"updated":"2020-01-02 16:53:44.000000000","message":"This will always raise and abort the context, even if ignore_events is empty. That should still result in the same behavior as expected here, assuming there are no lines of code after this in the context. However, it seems a little counter-intuitive when you read this that we\u0027re *always* exiting early, even though we\u0027re not if ignore_events is empty.\n\nWhen you respin this, can you either:\n\n - Add a conditional to only run this if ignore_events is not empty, or\n - Add a comment above it that says something about exiting here, which may or may not actually be early depending on if anything is in ignore_events\n\nI had to go re-read the exit_wait_early stuff from a month ago to remind myself, so it\u0027d be good to just call it out here explicitly one way or the other.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"e454cb6639c09987c8947c61f09efcd8de39c641","unresolved":false,"context_lines":[{"line_number":2744,"context_line":"                    instance.uuid, only_resolved\u003dTrue)"},{"line_number":2745,"context_line":"            ignore_events \u003d [(\u0027accelerator-request-bound\u0027, arq[\u0027uuid\u0027])"},{"line_number":2746,"context_line":"                             for arq in resolved_arqs]"},{"line_number":2747,"context_line":"            self.virtapi.exit_wait_early(ignore_events)"},{"line_number":2748,"context_line":""},{"line_number":2749,"context_line":"        # Since a timeout in wait_for_instance_event will raise, we get"},{"line_number":2750,"context_line":"        # here only if all binding events have been received."}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_a8cfac26","line":2747,"in_reply_to":"3fa7e38b_3b7b99f4","updated":"2020-01-15 07:04:59.000000000","message":"Done","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"af21a8f382e11e497d19a7f3e14a512245f12009","unresolved":false,"context_lines":[{"line_number":2607,"context_line":"            if dp_name:"},{"line_number":2608,"context_line":"                arqs \u003d self._get_bound_arq_resources("},{"line_number":2609,"context_line":"                        context, dp_name, instance)"},{"line_number":2610,"context_line":"        except (Exception, eventlet.timeout.Timeout) as exc:"},{"line_number":2611,"context_line":"            LOG.exception(exc.format_message())"},{"line_number":2612,"context_line":"            if network_info is not None:"},{"line_number":2613,"context_line":"                network_info.wait(do_raise\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":59,"id":"3fa7e38b_528ebad7","line":2610,"range":{"start_line":2610,"start_character":8,"end_line":2610,"end_character":60},"updated":"2020-02-05 11:00:30.000000000","message":"should you try to unbind the arqs if there is part of arqs successful?","commit_id":"02602e0238fbd85b99f60b0da91ab0a1a49dd39f"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"befa6ed92c5a82f36285332aabf86acbe4fa92b1","unresolved":false,"context_lines":[{"line_number":2607,"context_line":"            if dp_name:"},{"line_number":2608,"context_line":"                arqs \u003d self._get_bound_arq_resources("},{"line_number":2609,"context_line":"                        context, dp_name, instance)"},{"line_number":2610,"context_line":"        except (Exception, eventlet.timeout.Timeout) as exc:"},{"line_number":2611,"context_line":"            LOG.exception(exc.format_message())"},{"line_number":2612,"context_line":"            if network_info is not None:"},{"line_number":2613,"context_line":"                network_info.wait(do_raise\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":59,"id":"3fa7e38b_1b97fa39","line":2610,"range":{"start_line":2610,"start_character":8,"end_line":2610,"end_character":60},"in_reply_to":"3fa7e38b_528ebad7","updated":"2020-02-05 15:49:32.000000000","message":"On failure, Nova calls Cyborg to delete the ARQs [1], and Cyborg will unbind them as needed.\n\n[1] https://review.opendev.org/#/c/673735/33/nova/compute/manager.py@2614","commit_id":"02602e0238fbd85b99f60b0da91ab0a1a49dd39f"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"af21a8f382e11e497d19a7f3e14a512245f12009","unresolved":false,"context_lines":[{"line_number":2620,"context_line":""},{"line_number":2621,"context_line":"        try:"},{"line_number":2622,"context_line":"            yield resources"},{"line_number":2623,"context_line":"        except Exception as exc:"},{"line_number":2624,"context_line":"            with excutils.save_and_reraise_exception() as ctxt:"},{"line_number":2625,"context_line":"                if not isinstance(exc, ("},{"line_number":2626,"context_line":"                        exception.InstanceNotFound,"}],"source_content_type":"text/x-python","patch_set":59,"id":"3fa7e38b_729176f6","line":2623,"range":{"start_line":2623,"start_character":15,"end_line":2623,"end_character":31},"updated":"2020-02-05 11:00:30.000000000","message":"The spec said \"If the instance fails to spawn, Nova\nwould unbind the ARQ without deleting it. On instance termination, Nova would\ndelete the ARQs after unbinding them.\"\n\nSo I guess you need to do something at here?\n\nAnd one question, why we just unbind the ARQ without deleting it?","commit_id":"02602e0238fbd85b99f60b0da91ab0a1a49dd39f"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"befa6ed92c5a82f36285332aabf86acbe4fa92b1","unresolved":false,"context_lines":[{"line_number":2620,"context_line":""},{"line_number":2621,"context_line":"        try:"},{"line_number":2622,"context_line":"            yield resources"},{"line_number":2623,"context_line":"        except Exception as exc:"},{"line_number":2624,"context_line":"            with excutils.save_and_reraise_exception() as ctxt:"},{"line_number":2625,"context_line":"                if not isinstance(exc, ("},{"line_number":2626,"context_line":"                        exception.InstanceNotFound,"}],"source_content_type":"text/x-python","patch_set":59,"id":"3fa7e38b_1bc5ba35","line":2623,"range":{"start_line":2623,"start_character":15,"end_line":2623,"end_character":31},"in_reply_to":"3fa7e38b_729176f6","updated":"2020-02-05 15:49:32.000000000","message":"Since the time the spec was written, many changes were made. In particular, the creation and binding was moved from the compute manager back to the conductor. So, in practice, we only delete the ARQs on failure, and Cyborg takes care of unbinding if needed.","commit_id":"02602e0238fbd85b99f60b0da91ab0a1a49dd39f"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"438d6ffa8ad1d7fe4bb09c0f46fb69079d63914a","unresolved":false,"context_lines":[{"line_number":2670,"context_line":"        arqs \u003d cyclient.get_arqs_for_instance(instance.uuid)"},{"line_number":2671,"context_line":"        events \u003d [(\u0027accelerator-request-bound\u0027, arq[\u0027uuid\u0027]) for arq in arqs]"},{"line_number":2672,"context_line":"        timeout \u003d CONF.arq_binding_timeout or None"},{"line_number":2673,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2674,"context_line":"                instance, events, deadline\u003dtimeout):"},{"line_number":2675,"context_line":"            resolved_arqs \u003d cyclient.get_arqs_for_instance("},{"line_number":2676,"context_line":"                    instance.uuid, only_resolved\u003dTrue)"},{"line_number":2677,"context_line":"            # Events for these resolved ARQs may have already arrived."}],"source_content_type":"text/x-python","patch_set":59,"id":"3fa7e38b_321e9e5e","line":2674,"range":{"start_line":2673,"start_character":8,"end_line":2674,"end_character":52},"updated":"2020-02-05 10:13:19.000000000","message":"I guess we only can wait the event before bind the arq. Otherwise, the event can\u0027t be ignored https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L9844","commit_id":"02602e0238fbd85b99f60b0da91ab0a1a49dd39f"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"befa6ed92c5a82f36285332aabf86acbe4fa92b1","unresolved":false,"context_lines":[{"line_number":2670,"context_line":"        arqs \u003d cyclient.get_arqs_for_instance(instance.uuid)"},{"line_number":2671,"context_line":"        events \u003d [(\u0027accelerator-request-bound\u0027, arq[\u0027uuid\u0027]) for arq in arqs]"},{"line_number":2672,"context_line":"        timeout \u003d CONF.arq_binding_timeout or None"},{"line_number":2673,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2674,"context_line":"                instance, events, deadline\u003dtimeout):"},{"line_number":2675,"context_line":"            resolved_arqs \u003d cyclient.get_arqs_for_instance("},{"line_number":2676,"context_line":"                    instance.uuid, only_resolved\u003dTrue)"},{"line_number":2677,"context_line":"            # Events for these resolved ARQs may have already arrived."}],"source_content_type":"text/x-python","patch_set":59,"id":"3fa7e38b_bbd34602","line":2674,"range":{"start_line":2673,"start_character":8,"end_line":2674,"end_character":52},"in_reply_to":"3fa7e38b_12f92281","updated":"2020-02-05 15:49:32.000000000","message":"Yes.","commit_id":"02602e0238fbd85b99f60b0da91ab0a1a49dd39f"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"af21a8f382e11e497d19a7f3e14a512245f12009","unresolved":false,"context_lines":[{"line_number":2670,"context_line":"        arqs \u003d cyclient.get_arqs_for_instance(instance.uuid)"},{"line_number":2671,"context_line":"        events \u003d [(\u0027accelerator-request-bound\u0027, arq[\u0027uuid\u0027]) for arq in arqs]"},{"line_number":2672,"context_line":"        timeout \u003d CONF.arq_binding_timeout or None"},{"line_number":2673,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2674,"context_line":"                instance, events, deadline\u003dtimeout):"},{"line_number":2675,"context_line":"            resolved_arqs \u003d cyclient.get_arqs_for_instance("},{"line_number":2676,"context_line":"                    instance.uuid, only_resolved\u003dTrue)"},{"line_number":2677,"context_line":"            # Events for these resolved ARQs may have already arrived."}],"source_content_type":"text/x-python","patch_set":59,"id":"3fa7e38b_12f92281","line":2674,"range":{"start_line":2673,"start_character":8,"end_line":2674,"end_character":52},"in_reply_to":"3fa7e38b_321e9e5e","updated":"2020-02-05 11:00:30.000000000","message":"oh...i see now, we handle the early event...","commit_id":"02602e0238fbd85b99f60b0da91ab0a1a49dd39f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"618a11eddb87ba9bc20084387236cdb302e4091f","unresolved":false,"context_lines":[{"line_number":2609,"context_line":"                        context, dp_name, instance)"},{"line_number":2610,"context_line":"        except (Exception, eventlet.timeout.Timeout) as exc:"},{"line_number":2611,"context_line":"            LOG.exception(exc.format_message())"},{"line_number":2612,"context_line":"            if network_info is not None:"},{"line_number":2613,"context_line":"                network_info.wait(do_raise\u003dFalse)"},{"line_number":2614,"context_line":"                self.driver.clean_networks_preparation(instance, network_info)"},{"line_number":2615,"context_line":"            self.driver.failed_spawn_cleanup(instance)"},{"line_number":2616,"context_line":"            msg \u003d _(\u0027Failure getting accelerator requests.\u0027)"},{"line_number":2617,"context_line":"            raise exception.BuildAbortException(instance_uuid\u003dinstance.uuid,"},{"line_number":2618,"context_line":"                    reason\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":61,"id":"3fa7e38b_689ddb56","line":2615,"range":{"start_line":2612,"start_character":1,"end_line":2615,"end_character":54},"updated":"2020-02-07 17:17:34.000000000","message":"I suggest to factor out a cleanup function instead of copying the same exception handler block the 3rd time. Can be done in a follow up patch.","commit_id":"234a66647303f08253eb7adb0c6696ac43bccb2a"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"940016f36ef01fd317ca3bf4a2b2775fa5ccd67c","unresolved":false,"context_lines":[{"line_number":2609,"context_line":"                        context, dp_name, instance)"},{"line_number":2610,"context_line":"        except (Exception, eventlet.timeout.Timeout) as exc:"},{"line_number":2611,"context_line":"            LOG.exception(exc.format_message())"},{"line_number":2612,"context_line":"            if network_info is not None:"},{"line_number":2613,"context_line":"                network_info.wait(do_raise\u003dFalse)"},{"line_number":2614,"context_line":"                self.driver.clean_networks_preparation(instance, network_info)"},{"line_number":2615,"context_line":"            self.driver.failed_spawn_cleanup(instance)"},{"line_number":2616,"context_line":"            msg \u003d _(\u0027Failure getting accelerator requests.\u0027)"},{"line_number":2617,"context_line":"            raise exception.BuildAbortException(instance_uuid\u003dinstance.uuid,"},{"line_number":2618,"context_line":"                    reason\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":61,"id":"3fa7e38b_b6d1b758","line":2615,"range":{"start_line":2612,"start_character":1,"end_line":2615,"end_character":54},"in_reply_to":"3fa7e38b_689ddb56","updated":"2020-02-13 00:03:44.000000000","message":"Ok. I\u0027ll leave:\n\n   raise exception.BuildAbortException(...)\n\nin the main code because it is better to keep it explicit and also because it has different messages everytime.","commit_id":"234a66647303f08253eb7adb0c6696ac43bccb2a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"63cc81814a80488a8be4d32f3c74ce7cb33c685f","unresolved":false,"context_lines":[{"line_number":2596,"context_line":"            if dp_name:"},{"line_number":2597,"context_line":"                arqs \u003d self._get_bound_arq_resources("},{"line_number":2598,"context_line":"                        context, dp_name, instance)"},{"line_number":2599,"context_line":"        except (Exception, eventlet.timeout.Timeout) as exc:"},{"line_number":2600,"context_line":"            LOG.exception(exc.format_message())"},{"line_number":2601,"context_line":"            self._build_resources_cleanup(instance, network_info)"},{"line_number":2602,"context_line":"            msg \u003d _(\u0027Failure getting accelerator requests.\u0027)"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_b769b5f9","line":2599,"range":{"start_line":2599,"start_character":16,"end_line":2599,"end_character":51},"updated":"2020-03-06 04:01:10.000000000","message":"Every exception is subclass of Exception, so Exception already includes Timeout exception.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":14131,"name":"shaohef","email":"shaohe.feng@intel.com","username":"shaohefeng"},"change_message_id":"2eae7601dda64a149e971af90f7b277eb36a2870","unresolved":false,"context_lines":[{"line_number":2596,"context_line":"            if dp_name:"},{"line_number":2597,"context_line":"                arqs \u003d self._get_bound_arq_resources("},{"line_number":2598,"context_line":"                        context, dp_name, instance)"},{"line_number":2599,"context_line":"        except (Exception, eventlet.timeout.Timeout) as exc:"},{"line_number":2600,"context_line":"            LOG.exception(exc.format_message())"},{"line_number":2601,"context_line":"            self._build_resources_cleanup(instance, network_info)"},{"line_number":2602,"context_line":"            msg \u003d _(\u0027Failure getting accelerator requests.\u0027)"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_3da4bab9","line":2599,"range":{"start_line":2599,"start_character":16,"end_line":2599,"end_character":51},"in_reply_to":"1fa4df85_b769b5f9","updated":"2020-03-06 17:21:35.000000000","message":"In [21]: issubclass(eventlet.timeout.Timeout, BaseException)\nOut[21]: True\n\nIn [22]: issubclass(eventlet.timeout.Timeout, Exception)\nOut[22]: False","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"cd1c847451be0e0058ee414c6f89e3c6ed6e84f7","unresolved":false,"context_lines":[{"line_number":2596,"context_line":"            if dp_name:"},{"line_number":2597,"context_line":"                arqs \u003d self._get_bound_arq_resources("},{"line_number":2598,"context_line":"                        context, dp_name, instance)"},{"line_number":2599,"context_line":"        except (Exception, eventlet.timeout.Timeout) as exc:"},{"line_number":2600,"context_line":"            LOG.exception(exc.format_message())"},{"line_number":2601,"context_line":"            self._build_resources_cleanup(instance, network_info)"},{"line_number":2602,"context_line":"            msg \u003d _(\u0027Failure getting accelerator requests.\u0027)"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_d0923257","line":2599,"range":{"start_line":2599,"start_character":16,"end_line":2599,"end_character":51},"in_reply_to":"1fa4df85_b769b5f9","updated":"2020-03-06 14:37:28.000000000","message":"https://review.opendev.org/#/c/631244/53/nova/compute/manager.py@2678\n\nEventlet intentionally makes this difficult :(","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"63cc81814a80488a8be4d32f3c74ce7cb33c685f","unresolved":false,"context_lines":[{"line_number":2599,"context_line":"        except (Exception, eventlet.timeout.Timeout) as exc:"},{"line_number":2600,"context_line":"            LOG.exception(exc.format_message())"},{"line_number":2601,"context_line":"            self._build_resources_cleanup(instance, network_info)"},{"line_number":2602,"context_line":"            msg \u003d _(\u0027Failure getting accelerator requests.\u0027)"},{"line_number":2603,"context_line":"            raise exception.BuildAbortException(instance_uuid\u003dinstance.uuid,"},{"line_number":2604,"context_line":"                    reason\u003dmsg)"},{"line_number":2605,"context_line":"        resources[\u0027accel_info\u0027] \u003d arqs"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_576ac1ec","line":2602,"updated":"2020-03-06 04:01:10.000000000","message":"yea...I saw you cleanup arq in later patch. It is a little strange to do that in separated patch.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"65d58351bad22fa57836ac9400ede66b75b19654","unresolved":false,"context_lines":[{"line_number":2599,"context_line":"        except (Exception, eventlet.timeout.Timeout) as exc:"},{"line_number":2600,"context_line":"            LOG.exception(exc.format_message())"},{"line_number":2601,"context_line":"            self._build_resources_cleanup(instance, network_info)"},{"line_number":2602,"context_line":"            msg \u003d _(\u0027Failure getting accelerator requests.\u0027)"},{"line_number":2603,"context_line":"            raise exception.BuildAbortException(instance_uuid\u003dinstance.uuid,"},{"line_number":2604,"context_line":"                    reason\u003dmsg)"},{"line_number":2605,"context_line":"        resources[\u0027accel_info\u0027] \u003d arqs"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_567f0baa","line":2602,"in_reply_to":"1fa4df85_576ac1ec","updated":"2020-03-08 23:24:35.000000000","message":"Deletion of ARQs is handled in a subsequent patch. Is that what you are referring to? We don\u0027t want to put everything in one patch.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"63cc81814a80488a8be4d32f3c74ce7cb33c685f","unresolved":false,"context_lines":[{"line_number":2655,"context_line":"        cyclient \u003d cyborg.get_client(context)"},{"line_number":2656,"context_line":"        arqs \u003d cyclient.get_arqs_for_instance(instance.uuid)"},{"line_number":2657,"context_line":"        events \u003d [(\u0027accelerator-request-bound\u0027, arq[\u0027uuid\u0027]) for arq in arqs]"},{"line_number":2658,"context_line":"        timeout \u003d CONF.arq_binding_timeout or None"},{"line_number":2659,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2660,"context_line":"                instance, events, deadline\u003dtimeout):"},{"line_number":2661,"context_line":"            resolved_arqs \u003d cyclient.get_arqs_for_instance("}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_b752153a","line":2658,"range":{"start_line":2658,"start_character":43,"end_line":2658,"end_character":50},"updated":"2020-03-06 04:01:10.000000000","message":"You never can reach this? since the min value for this config is 1","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"65d58351bad22fa57836ac9400ede66b75b19654","unresolved":false,"context_lines":[{"line_number":2655,"context_line":"        cyclient \u003d cyborg.get_client(context)"},{"line_number":2656,"context_line":"        arqs \u003d cyclient.get_arqs_for_instance(instance.uuid)"},{"line_number":2657,"context_line":"        events \u003d [(\u0027accelerator-request-bound\u0027, arq[\u0027uuid\u0027]) for arq in arqs]"},{"line_number":2658,"context_line":"        timeout \u003d CONF.arq_binding_timeout or None"},{"line_number":2659,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":2660,"context_line":"                instance, events, deadline\u003dtimeout):"},{"line_number":2661,"context_line":"            resolved_arqs \u003d cyclient.get_arqs_for_instance("}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_f6471776","line":2658,"range":{"start_line":2658,"start_character":43,"end_line":2658,"end_character":50},"in_reply_to":"1fa4df85_b752153a","updated":"2020-03-08 23:24:35.000000000","message":"Done","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"c82d7da3152afc30cf5f5129762492a8590946f2","unresolved":false,"context_lines":[{"line_number":2235,"context_line":"            self.reportclient.delete_allocation_for_instance(context,"},{"line_number":2236,"context_line":"                                                             instance.uuid)"},{"line_number":2237,"context_line":""},{"line_number":2238,"context_line":"            self.compute_task_api.build_instances(context, [instance],"},{"line_number":2239,"context_line":"                    image, filter_properties, admin_password,"},{"line_number":2240,"context_line":"                    injected_files, requested_networks, security_groups,"},{"line_number":2241,"context_line":"                    block_device_mapping, request_spec\u003drequest_spec,"}],"source_content_type":"text/x-python","patch_set":69,"id":"df33271e_0a84a85d","line":2238,"updated":"2020-03-25 03:44:10.000000000","message":"Before this rescheduler, we also need to cleanup the arqs mapping info in Cyborg db. This maybe can caused by \"yield resources\" in _build_resources() [1], which is already complted the arqs bind for the instance.\n\n[1]https://opendev.org/openstack/nova/src/branch/stable/rocky/nova/compute/manager.py#L2486","commit_id":"cc630b4eb62c4a45ff08a1862a8339a0f129e0a3"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"74b392cfa71c427edbc421c2993ede2d1b9275d4","unresolved":false,"context_lines":[{"line_number":2596,"context_line":"                arqs \u003d self._get_bound_arq_resources("},{"line_number":2597,"context_line":"                        context, dp_name, instance)"},{"line_number":2598,"context_line":"        except (Exception, eventlet.timeout.Timeout) as exc:"},{"line_number":2599,"context_line":"            LOG.exception(exc.format_message())"},{"line_number":2600,"context_line":"            self._build_resources_cleanup(instance, network_info)"},{"line_number":2601,"context_line":"            msg \u003d _(\u0027Failure getting accelerator requests.\u0027)"},{"line_number":2602,"context_line":"            raise exception.BuildAbortException(instance_uuid\u003dinstance.uuid,"}],"source_content_type":"text/x-python","patch_set":69,"id":"df33271e_c72960e6","line":2599,"range":{"start_line":2599,"start_character":12,"end_line":2599,"end_character":47},"updated":"2020-04-02 23:45:31.000000000","message":"this is a bug\nit should just be exc not exc.format_message.\n\nfromat_message is specific to nova excptions so it is incorrect to call it on generic excepetions or eventlet timeouts.","commit_id":"cc630b4eb62c4a45ff08a1862a8339a0f129e0a3"}],"nova/conductor/manager.py":[{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"772d3ce1b474f49c23b9e29f78c10533423fb2ca","unresolved":false,"context_lines":[{"line_number":1234,"context_line":"                    inst.destroy()"},{"line_number":1235,"context_line":""},{"line_number":1236,"context_line":"    def _get_device_resource_provider(self, context, arq, host):"},{"line_number":1237,"context_line":"        \"\"\"We need logic to match ARQs with request groups and RPs."},{"line_number":1238,"context_line":""},{"line_number":1239,"context_line":"           FIXME"},{"line_number":1240,"context_line":"           For now, we assume that there is only one nested RP that"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_6825e7c1","line":1237,"range":{"start_line":1237,"start_character":34,"end_line":1237,"end_character":38},"updated":"2019-02-12 02:09:07.000000000","message":"could we have a better name for this? I know that cyborg is adding an API /arqs is it ``AcceleratorRequests?, it is really hard to follow as ARQ is a well-known word(Automatic Repeat-reQuest). It is really easy to misunderstand this.","commit_id":"369cf0f2a4d890f341d72d06be451cecdee04ea4"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a292ee4a44f16382198996abd5103c7fcf65d11b","unresolved":false,"context_lines":[{"line_number":1234,"context_line":"                    inst.destroy()"},{"line_number":1235,"context_line":""},{"line_number":1236,"context_line":"    def _get_device_resource_provider(self, context, arq, host):"},{"line_number":1237,"context_line":"        \"\"\"We need logic to match ARQs with request groups and RPs."},{"line_number":1238,"context_line":""},{"line_number":1239,"context_line":"           FIXME"},{"line_number":1240,"context_line":"           For now, we assume that there is only one nested RP that"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_cd05f811","line":1237,"range":{"start_line":1237,"start_character":34,"end_line":1237,"end_character":38},"in_reply_to":"9fdfeff1_6825e7c1","updated":"2019-02-12 14:12:39.000000000","message":"We\u0027ve already iterated on this a couple of times. Do you have a suggestion? Is there really a danger of confusing this with Automatic Repeat Request?","commit_id":"369cf0f2a4d890f341d72d06be451cecdee04ea4"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"ddce84b9b2a46555ed202f56400171afad265fea","unresolved":false,"context_lines":[{"line_number":1234,"context_line":"                    inst.destroy()"},{"line_number":1235,"context_line":""},{"line_number":1236,"context_line":"    def _get_device_resource_provider(self, context, arq, host):"},{"line_number":1237,"context_line":"        \"\"\"We need logic to match ARQs with request groups and RPs."},{"line_number":1238,"context_line":""},{"line_number":1239,"context_line":"           FIXME"},{"line_number":1240,"context_line":"           For now, we assume that there is only one nested RP that"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_e95d4247","line":1237,"range":{"start_line":1237,"start_character":34,"end_line":1237,"end_character":38},"in_reply_to":"9fdfeff1_cd05f811","updated":"2019-02-13 02:07:17.000000000","message":"Hmm, maybe not, since if people are trying to do dev on this, they might have some docs illustrating these concepts. But, shouldn\u0027t we just use names like AcceleratorRequests ? This makes it much more easier to understand, and all the other projects uses name like this, we only used abbreviations on well-known concepts like IPs, DNS, not this kind of resources.","commit_id":"369cf0f2a4d890f341d72d06be451cecdee04ea4"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"1a8b85aa8cf570b6fb094f7d92003109e60b1a87","unresolved":false,"context_lines":[{"line_number":1234,"context_line":"                    inst.destroy()"},{"line_number":1235,"context_line":""},{"line_number":1236,"context_line":"    def _get_device_resource_provider(self, context, arq, host):"},{"line_number":1237,"context_line":"        \"\"\"We need logic to match ARQs with request groups and RPs."},{"line_number":1238,"context_line":""},{"line_number":1239,"context_line":"           FIXME"},{"line_number":1240,"context_line":"           For now, we assume that there is only one nested RP that"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_eeaa6d18","line":1237,"range":{"start_line":1237,"start_character":34,"end_line":1237,"end_character":38},"in_reply_to":"9fdfeff1_e95d4247","updated":"2019-02-22 00:40:53.000000000","message":"Zhenyu, here are some precedents. In [1], does fw stand for \u0027firmware\u0027 or \u0027firewall\u0027?\n\nIn [2], we use a made-up acronym vif (virtual interface).\n\nIn [3], what is luks?\n\nMore to the point, I see ARQ as similar to the term \u0027vif\u0027. Also, we can expand it in comments.\n\n[1] https://github.com/openstack/nova/blob/master/nova/conductor/manager.py#L115\n[2] https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L851\n[3] https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L1322","commit_id":"369cf0f2a4d890f341d72d06be451cecdee04ea4"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0bf3028451ebc67bff2d1412f600e96f532a5273","unresolved":false,"context_lines":[{"line_number":1236,"context_line":"    def _get_device_resource_provider(self, context, arq, host):"},{"line_number":1237,"context_line":"        \"\"\"We need logic to match ARQs with request groups and RPs."},{"line_number":1238,"context_line":""},{"line_number":1239,"context_line":"           FIXME"},{"line_number":1240,"context_line":"           For now, we assume that there is only one nested RP that"},{"line_number":1241,"context_line":"           has an accelerator resource."},{"line_number":1242,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_1717b853","line":1239,"range":{"start_line":1239,"start_character":11,"end_line":1239,"end_character":16},"updated":"2019-02-08 23:55:13.000000000","message":"this is spelled\n\n TODO(Sundar):\n\n:p","commit_id":"369cf0f2a4d890f341d72d06be451cecdee04ea4"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"1a8b85aa8cf570b6fb094f7d92003109e60b1a87","unresolved":false,"context_lines":[{"line_number":1236,"context_line":"    def _get_device_resource_provider(self, context, arq, host):"},{"line_number":1237,"context_line":"        \"\"\"We need logic to match ARQs with request groups and RPs."},{"line_number":1238,"context_line":""},{"line_number":1239,"context_line":"           FIXME"},{"line_number":1240,"context_line":"           For now, we assume that there is only one nested RP that"},{"line_number":1241,"context_line":"           has an accelerator resource."},{"line_number":1242,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_6e1bdd7f","line":1239,"range":{"start_line":1239,"start_character":11,"end_line":1239,"end_character":16},"in_reply_to":"9fdfeff1_1717b853","updated":"2019-02-22 00:40:53.000000000","message":"Done","commit_id":"369cf0f2a4d890f341d72d06be451cecdee04ea4"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0bf3028451ebc67bff2d1412f600e96f532a5273","unresolved":false,"context_lines":[{"line_number":1243,"context_line":"        allocreq_json \u003d host.allocation_request"},{"line_number":1244,"context_line":"        allocreq \u003d jsonutils.loads(allocreq_json)"},{"line_number":1245,"context_line":"        alloc \u003d allocreq[\u0027allocations\u0027]"},{"line_number":1246,"context_line":"        device_rp \u003d None"},{"line_number":1247,"context_line":"        for rp_uuid, val in alloc.items():"},{"line_number":1248,"context_line":"            res \u003d val[\u0027resources\u0027]"},{"line_number":1249,"context_line":"            for r in res.keys():"},{"line_number":1250,"context_line":"                if \u0027ACCELERATOR\u0027 in r:"},{"line_number":1251,"context_line":"                    device_rp \u003d rp_uuid"},{"line_number":1252,"context_line":"                    break"},{"line_number":1253,"context_line":"        return device_rp"},{"line_number":1254,"context_line":""},{"line_number":1255,"context_line":"    def _create_and_bind_arqs(self, context, request_spec, host, instance):"},{"line_number":1256,"context_line":"        dp_name \u003d request_spec.flavor.device_profile_name"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_522b0e81","line":1253,"range":{"start_line":1246,"start_character":0,"end_line":1253,"end_character":24},"updated":"2019-02-08 23:55:13.000000000","message":"or\n\n for rp_uuid, val in alloc.items():\n     if \u0027ACCELERATOR\u0027 in val[\u0027resources\u0027]:\n         return rp_uuid\n return None","commit_id":"369cf0f2a4d890f341d72d06be451cecdee04ea4"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"1a8b85aa8cf570b6fb094f7d92003109e60b1a87","unresolved":false,"context_lines":[{"line_number":1243,"context_line":"        allocreq_json \u003d host.allocation_request"},{"line_number":1244,"context_line":"        allocreq \u003d jsonutils.loads(allocreq_json)"},{"line_number":1245,"context_line":"        alloc \u003d allocreq[\u0027allocations\u0027]"},{"line_number":1246,"context_line":"        device_rp \u003d None"},{"line_number":1247,"context_line":"        for rp_uuid, val in alloc.items():"},{"line_number":1248,"context_line":"            res \u003d val[\u0027resources\u0027]"},{"line_number":1249,"context_line":"            for r in res.keys():"},{"line_number":1250,"context_line":"                if \u0027ACCELERATOR\u0027 in r:"},{"line_number":1251,"context_line":"                    device_rp \u003d rp_uuid"},{"line_number":1252,"context_line":"                    break"},{"line_number":1253,"context_line":"        return device_rp"},{"line_number":1254,"context_line":""},{"line_number":1255,"context_line":"    def _create_and_bind_arqs(self, context, request_spec, host, instance):"},{"line_number":1256,"context_line":"        dp_name \u003d request_spec.flavor.device_profile_name"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_ae00e503","line":1253,"range":{"start_line":1246,"start_character":0,"end_line":1253,"end_character":24},"in_reply_to":"9fdfeff1_522b0e81","updated":"2019-02-22 00:40:53.000000000","message":"Done","commit_id":"369cf0f2a4d890f341d72d06be451cecdee04ea4"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0bf3028451ebc67bff2d1412f600e96f532a5273","unresolved":false,"context_lines":[{"line_number":1252,"context_line":"                    break"},{"line_number":1253,"context_line":"        return device_rp"},{"line_number":1254,"context_line":""},{"line_number":1255,"context_line":"    def _create_and_bind_arqs(self, context, request_spec, host, instance):"},{"line_number":1256,"context_line":"        dp_name \u003d request_spec.flavor.device_profile_name"},{"line_number":1257,"context_line":"        if not dp_name:"},{"line_number":1258,"context_line":"            LOG.info(\u0027No device profile in request.\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_5250ee0a","line":1255,"range":{"start_line":1255,"start_character":8,"end_line":1255,"end_character":29},"updated":"2019-02-08 23:55:13.000000000","message":"From a future-design perspective: This is where cyborg could conceivably kick off FPGA reprogramming as a result of the binding?","commit_id":"369cf0f2a4d890f341d72d06be451cecdee04ea4"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"1a8b85aa8cf570b6fb094f7d92003109e60b1a87","unresolved":false,"context_lines":[{"line_number":1252,"context_line":"                    break"},{"line_number":1253,"context_line":"        return device_rp"},{"line_number":1254,"context_line":""},{"line_number":1255,"context_line":"    def _create_and_bind_arqs(self, context, request_spec, host, instance):"},{"line_number":1256,"context_line":"        dp_name \u003d request_spec.flavor.device_profile_name"},{"line_number":1257,"context_line":"        if not dp_name:"},{"line_number":1258,"context_line":"            LOG.info(\u0027No device profile in request.\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_82fdb509","line":1255,"range":{"start_line":1255,"start_character":8,"end_line":1255,"end_character":29},"in_reply_to":"9fdfeff1_5250ee0a","updated":"2019-02-22 00:40:53.000000000","message":"Yes","commit_id":"369cf0f2a4d890f341d72d06be451cecdee04ea4"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0bf3028451ebc67bff2d1412f600e96f532a5273","unresolved":false,"context_lines":[{"line_number":1279,"context_line":"            # Initiate Cyborg binding asynchronously"},{"line_number":1280,"context_line":"            cyclient.bind_arqs(bindings\u003dbindings)"},{"line_number":1281,"context_line":"        else:"},{"line_number":1282,"context_line":"            # TODO(Sundar): Use CONF var to decide if this is fatal"},{"line_number":1283,"context_line":"            LOG.warning(\u0027No ARQs were created for instance %s\u0027,"},{"line_number":1284,"context_line":"                        instance.uuid)"},{"line_number":1285,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_97c40861","line":1282,"range":{"start_line":1282,"start_character":12,"end_line":1282,"end_character":67},"updated":"2019-02-08 23:55:13.000000000","message":"Nah, it\u0027s fatal. But reschedulable. (Let\u0027s not add any more conf vars if we can possibly help it.)","commit_id":"369cf0f2a4d890f341d72d06be451cecdee04ea4"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"1a8b85aa8cf570b6fb094f7d92003109e60b1a87","unresolved":false,"context_lines":[{"line_number":1279,"context_line":"            # Initiate Cyborg binding asynchronously"},{"line_number":1280,"context_line":"            cyclient.bind_arqs(bindings\u003dbindings)"},{"line_number":1281,"context_line":"        else:"},{"line_number":1282,"context_line":"            # TODO(Sundar): Use CONF var to decide if this is fatal"},{"line_number":1283,"context_line":"            LOG.warning(\u0027No ARQs were created for instance %s\u0027,"},{"line_number":1284,"context_line":"                        instance.uuid)"},{"line_number":1285,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_620a1121","line":1282,"range":{"start_line":1282,"start_character":12,"end_line":1282,"end_character":67},"in_reply_to":"9fdfeff1_97c40861","updated":"2019-02-22 00:40:53.000000000","message":"This method itself has been removed in later versions.","commit_id":"369cf0f2a4d890f341d72d06be451cecdee04ea4"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0bf3028451ebc67bff2d1412f600e96f532a5273","unresolved":false,"context_lines":[{"line_number":1434,"context_line":"                # this one."},{"line_number":1435,"context_line":"                continue"},{"line_number":1436,"context_line":""},{"line_number":1437,"context_line":"            self._create_and_bind_arqs(context, request_spec, host, instance)"},{"line_number":1438,"context_line":""},{"line_number":1439,"context_line":"            # NOTE(danms): Compute RPC expects security group names or ids"},{"line_number":1440,"context_line":"            # not objects, so convert this to a list of names until we can"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_772e44a6","line":1437,"updated":"2019-02-08 23:55:13.000000000","message":"Sort of wondering whether this ought to be done on the other side of the wire, like in or near instance_claim/_build_resources [1].\n\nI think I get the advantage to doing it here. But I\u0027m just not sure.\n\nAlso, where does the cleanup for this go (unbind/delete ARQs if the build fails and/or is rescheduled)?\n\n[1] https://github.com/openstack/nova/blob/a6963fa6858289d048e4d27ce8e61637cd023f4c/nova/compute/manager.py#L2116-L2123","commit_id":"369cf0f2a4d890f341d72d06be451cecdee04ea4"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b223f4d0583b0f4de2a6e7243b6c27636b35ae38","unresolved":false,"context_lines":[{"line_number":1605,"context_line":"        \"\"\""},{"line_number":1606,"context_line":"        dp_name \u003d instance.flavor.extra_specs.get(\u0027accel:device_profile\u0027)"},{"line_number":1607,"context_line":"        if not dp_name:"},{"line_number":1608,"context_line":"            LOG.info(\u0027No device profile name.\u0027)"},{"line_number":1609,"context_line":"            return"},{"line_number":1610,"context_line":""},{"line_number":1611,"context_line":"        LOG.info(\u0027Calling Cyborg to get ARQs. map\u003d%s\u0027,"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_48b59131","line":1608,"updated":"2019-12-04 15:08:51.000000000","message":"So you\u0027re going to log this semi-error-looking message for every instance in the system that doesn\u0027t have an accelerator? That\u0027s not reasonable, IMHO. Just remove it.","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"14c3bb47bd071a2e4542f5530e7a25f25f235769","unresolved":false,"context_lines":[{"line_number":1605,"context_line":"        \"\"\""},{"line_number":1606,"context_line":"        dp_name \u003d instance.flavor.extra_specs.get(\u0027accel:device_profile\u0027)"},{"line_number":1607,"context_line":"        if not dp_name:"},{"line_number":1608,"context_line":"            LOG.info(\u0027No device profile name.\u0027)"},{"line_number":1609,"context_line":"            return"},{"line_number":1610,"context_line":""},{"line_number":1611,"context_line":"        LOG.info(\u0027Calling Cyborg to get ARQs. map\u003d%s\u0027,"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_f72a142d","line":1608,"in_reply_to":"3fa7e38b_48b59131","updated":"2019-12-09 03:50:21.000000000","message":"Done","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b223f4d0583b0f4de2a6e7243b6c27636b35ae38","unresolved":false,"context_lines":[{"line_number":1609,"context_line":"            return"},{"line_number":1610,"context_line":""},{"line_number":1611,"context_line":"        LOG.info(\u0027Calling Cyborg to get ARQs. map\u003d%s\u0027,"},{"line_number":1612,"context_line":"                 resource_provider_mapping)"},{"line_number":1613,"context_line":"        cyclient \u003d cyborg.get_client(context)"},{"line_number":1614,"context_line":"        arqs \u003d cyclient.create_arqs_and_match_resource_providers("},{"line_number":1615,"context_line":"            dp_name, resource_provider_mapping)"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_c87ae175","line":1612,"updated":"2019-12-04 15:08:51.000000000","message":"This is definitely not info level. I\u0027m not sure why we need to dump the mapping even at debug level. Is this something we\u0027re likely to be able to use during actual debugging?","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"14c3bb47bd071a2e4542f5530e7a25f25f235769","unresolved":false,"context_lines":[{"line_number":1609,"context_line":"            return"},{"line_number":1610,"context_line":""},{"line_number":1611,"context_line":"        LOG.info(\u0027Calling Cyborg to get ARQs. map\u003d%s\u0027,"},{"line_number":1612,"context_line":"                 resource_provider_mapping)"},{"line_number":1613,"context_line":"        cyclient \u003d cyborg.get_client(context)"},{"line_number":1614,"context_line":"        arqs \u003d cyclient.create_arqs_and_match_resource_providers("},{"line_number":1615,"context_line":"            dp_name, resource_provider_mapping)"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_17bc90d9","line":1612,"in_reply_to":"3fa7e38b_c87ae175","updated":"2019-12-09 03:50:21.000000000","message":"The mapping would be useful when there are multiple devices in the host and we want to see which ARQ is going to which device. But that info is implicit in the arqs dumped in Line 1615 below. So, I\u0027ll change this.","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b223f4d0583b0f4de2a6e7243b6c27636b35ae38","unresolved":false,"context_lines":[{"line_number":1613,"context_line":"        cyclient \u003d cyborg.get_client(context)"},{"line_number":1614,"context_line":"        arqs \u003d cyclient.create_arqs_and_match_resource_providers("},{"line_number":1615,"context_line":"            dp_name, resource_provider_mapping)"},{"line_number":1616,"context_line":"        LOG.info(\u0027Got ARQs %s\u0027, arqs)"},{"line_number":1617,"context_line":""},{"line_number":1618,"context_line":"        bindings \u003d {arq[\u0027uuid\u0027]:"},{"line_number":1619,"context_line":"                       {\"hostname\": hostname,"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_8894e98d","line":1616,"updated":"2019-12-04 15:08:51.000000000","message":"Definitely not info level.","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"14c3bb47bd071a2e4542f5530e7a25f25f235769","unresolved":false,"context_lines":[{"line_number":1613,"context_line":"        cyclient \u003d cyborg.get_client(context)"},{"line_number":1614,"context_line":"        arqs \u003d cyclient.create_arqs_and_match_resource_providers("},{"line_number":1615,"context_line":"            dp_name, resource_provider_mapping)"},{"line_number":1616,"context_line":"        LOG.info(\u0027Got ARQs %s\u0027, arqs)"},{"line_number":1617,"context_line":""},{"line_number":1618,"context_line":"        bindings \u003d {arq[\u0027uuid\u0027]:"},{"line_number":1619,"context_line":"                       {\"hostname\": hostname,"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_d7b598ee","line":1616,"in_reply_to":"3fa7e38b_8894e98d","updated":"2019-12-09 03:50:21.000000000","message":"Done","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b223f4d0583b0f4de2a6e7243b6c27636b35ae38","unresolved":false,"context_lines":[{"line_number":1622,"context_line":"                       }"},{"line_number":1623,"context_line":"                    for arq in arqs}"},{"line_number":1624,"context_line":"        # Initiate Cyborg binding asynchronously"},{"line_number":1625,"context_line":"        cyclient.bind_arqs(bindings\u003dbindings)"},{"line_number":1626,"context_line":""},{"line_number":1627,"context_line":"    @staticmethod"},{"line_number":1628,"context_line":"    def _map_instance_to_cell(context, instance, cell):"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_28d2955c","line":1625,"updated":"2019-12-04 15:08:51.000000000","message":"This can raise if it fails, which will bubble up to L1578. Don\u0027t you need to catch that and do some cleanup there?","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"14c3bb47bd071a2e4542f5530e7a25f25f235769","unresolved":false,"context_lines":[{"line_number":1622,"context_line":"                       }"},{"line_number":1623,"context_line":"                    for arq in arqs}"},{"line_number":1624,"context_line":"        # Initiate Cyborg binding asynchronously"},{"line_number":1625,"context_line":"        cyclient.bind_arqs(bindings\u003dbindings)"},{"line_number":1626,"context_line":""},{"line_number":1627,"context_line":"    @staticmethod"},{"line_number":1628,"context_line":"    def _map_instance_to_cell(context, instance, cell):"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_09453f6f","line":1625,"in_reply_to":"3fa7e38b_28d2955c","updated":"2019-12-09 03:50:21.000000000","message":"Done","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"14c3bb47bd071a2e4542f5530e7a25f25f235769","unresolved":false,"context_lines":[{"line_number":1573,"context_line":"                # this one."},{"line_number":1574,"context_line":"                continue"},{"line_number":1575,"context_line":""},{"line_number":1576,"context_line":"            try:"},{"line_number":1577,"context_line":"                resource_provider_mapping \u003d ("},{"line_number":1578,"context_line":"                    request_spec.get_request_group_mapping())"},{"line_number":1579,"context_line":"                # Using nodename instead of hostname. See:"}],"source_content_type":"text/x-python","patch_set":48,"id":"3fa7e38b_5fd0b02b","line":1576,"updated":"2019-12-09 03:50:21.000000000","message":"This block could be combined with the try/except for fill_provider _mapping, i.e., we could stick this after Line 1536 [1]. Any reasons not to?\n\n[1] https://review.opendev.org/gitweb?p\u003dopenstack/nova.git;f\u003dnova/conductor/manager.py;hb\u003drefs/changes/44/631244/48#l1536","commit_id":"60e6677afddbf81a51c8700749cb86b5113b2b5d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"61726192904533f3e4821ab18f58271b19122c2b","unresolved":false,"context_lines":[{"line_number":1575,"context_line":"                    request_spec.get_request_group_mapping())"},{"line_number":1576,"context_line":"                # Using nodename instead of hostname. See:"},{"line_number":1577,"context_line":"                # http://lists.openstack.org/pipermail/openstack-discuss/2019-November/011044.html  # noqa"},{"line_number":1578,"context_line":"                self._create_and_bind_arqs(context, instance, host.nodename,"},{"line_number":1579,"context_line":"                                       resource_provider_mapping)"},{"line_number":1580,"context_line":"            except Exception as exc:"},{"line_number":1581,"context_line":"                # If anything failed here we need to cleanup and bail out."}],"source_content_type":"text/x-python","patch_set":51,"id":"3fa7e38b_84f789d4","line":1578,"updated":"2019-12-11 22:22:16.000000000","message":"This is an upgrade breakage as it currently sits. If the nova control plane is new, and cyborg agent is running on the compute, we would be fooled into doing this work and then calling off to a potentially-old n-cpu service, which isn\u0027t going to do anything we\u0027re expecting.\n\nIdeally we would bump the RPC version and communicate our intent directly and explicitly. However, at a minimum we need to make sure that we don\u0027t assume that it\u0027s going to happen and either arrange to never select an old compute, or check for it and explode ahead of time. It sounds like the preference for minimum accounting for this possibility is to have compute export a trait indicating that it can do cyborg stuff, which we can chuck into the scheduling request (if we have accels to do) to filter out computes without that capability. Cyborg can also use that to notice when computes aren\u0027t yet new enough to handle having accelerator inventory underneath.","commit_id":"14f3a38db4998d07fd511178956361fec45f8605"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"932dd66a9acbb8bce155208c5955464a818bd280","unresolved":false,"context_lines":[{"line_number":1575,"context_line":"                    request_spec.get_request_group_mapping())"},{"line_number":1576,"context_line":"                # Using nodename instead of hostname. See:"},{"line_number":1577,"context_line":"                # http://lists.openstack.org/pipermail/openstack-discuss/2019-November/011044.html  # noqa"},{"line_number":1578,"context_line":"                self._create_and_bind_arqs(context, instance, host.nodename,"},{"line_number":1579,"context_line":"                                       resource_provider_mapping)"},{"line_number":1580,"context_line":"            except Exception as exc:"},{"line_number":1581,"context_line":"                # If anything failed here we need to cleanup and bail out."}],"source_content_type":"text/x-python","patch_set":51,"id":"3fa7e38b_cfe820a8","line":1578,"in_reply_to":"3fa7e38b_5b22b955","updated":"2019-12-13 15:08:27.000000000","message":"\u003e I am open to updating Cyborg to query this trait before publishing\n \u003e nested RPs.\n\n++\n\n \u003e * Have the current patch series add that trait to each device\n \u003e profile request group coming from Cyborg (so Placement gets queried\n \u003e with it).\n\nFWIW, I still don\u0027t like this.\n\nBut if you\u0027re going to do it, you can\u0027t add the trait to the device profile request groups, because that would cause Placement to look for it in the accel RPs, and that\u0027s not where it is. You want Placement to look for it in the root RP. Prior to Placement 1.35, you would have had to hack that into the unsuffixed request group, which sucks. But with 1.35, you can use the root_required queryparam -- this is what it\u0027s designed for.\n\nAs of this writing, we\u0027re doing GET /a_c at 1.34, but bumping it to 1.35 is a pretty easy patch. See e.g. [1] (ignore utils.py, test_report_client.py, and test_utils.py).\n\n[1] https://review.opendev.org/#/c/696418/","commit_id":"14f3a38db4998d07fd511178956361fec45f8605"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"599db8f2f93c18eb10112ec15e91a39441701a37","unresolved":false,"context_lines":[{"line_number":1575,"context_line":"                    request_spec.get_request_group_mapping())"},{"line_number":1576,"context_line":"                # Using nodename instead of hostname. See:"},{"line_number":1577,"context_line":"                # http://lists.openstack.org/pipermail/openstack-discuss/2019-November/011044.html  # noqa"},{"line_number":1578,"context_line":"                self._create_and_bind_arqs(context, instance, host.nodename,"},{"line_number":1579,"context_line":"                                       resource_provider_mapping)"},{"line_number":1580,"context_line":"            except Exception as exc:"},{"line_number":1581,"context_line":"                # If anything failed here we need to cleanup and bail out."}],"source_content_type":"text/x-python","patch_set":51,"id":"3fa7e38b_5b22b955","line":1578,"in_reply_to":"3fa7e38b_84f789d4","updated":"2019-12-13 05:43:11.000000000","message":"Agreed. specifically, I will post separate patches for these:\n* Create a new os_trait, say COMPUTE_ACCELERATORS_BUILD (along the lines of COMPUTE_VOLUME_EXTEND). In the future, when we get to hot add/delete, we could add COMPUTE_ACCELERATORS_ATTACH.\n* Have the virt driver publish that as a trait.\n* Have the current patch series add that trait to each device profile request group coming from Cyborg (so Placement gets queried with it).\n\nI am open to updating Cyborg to query this trait before publishing nested RPs. I have brought this comment to the notice of Cyborg community, and am awaiting their response.","commit_id":"14f3a38db4998d07fd511178956361fec45f8605"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"423c3ddc29fd1382447485f52a5ff03562cb57a5","unresolved":false,"context_lines":[{"line_number":1575,"context_line":"                    request_spec.get_request_group_mapping())"},{"line_number":1576,"context_line":"                # Using nodename instead of hostname. See:"},{"line_number":1577,"context_line":"                # http://lists.openstack.org/pipermail/openstack-discuss/2019-November/011044.html  # noqa"},{"line_number":1578,"context_line":"                self._create_and_bind_arqs(context, instance, host.nodename,"},{"line_number":1579,"context_line":"                                       resource_provider_mapping)"},{"line_number":1580,"context_line":"            except Exception as exc:"},{"line_number":1581,"context_line":"                # If anything failed here we need to cleanup and bail out."}],"source_content_type":"text/x-python","patch_set":51,"id":"3fa7e38b_68fd6206","line":1578,"in_reply_to":"3fa7e38b_cfe820a8","updated":"2019-12-13 17:05:49.000000000","message":"Reference to IRC discussion where all agreed that the compute manager shall publish a new trait and that the scheduler will use it to weed out older nodes:\n\nhttp://eavesdrop.openstack.org/irclogs/%23openstack-nova/%23openstack-nova.2019-12-13.log.html#t2019-12-13T15:47:17 \n\n\nThe description in this patch provides more context: https://review.opendev.org/#/c/698961/","commit_id":"14f3a38db4998d07fd511178956361fec45f8605"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"faa1d71ff475c4520ae46390e025c8e8c2106b9c","unresolved":false,"context_lines":[{"line_number":1582,"context_line":"                    self._cleanup_build_artifacts("},{"line_number":1583,"context_line":"                        context, exc, instances, build_requests, request_specs,"},{"line_number":1584,"context_line":"                        block_device_mapping, tags, cell_mapping_cache)"},{"line_number":1585,"context_line":""},{"line_number":1586,"context_line":"            # NOTE(danms): Compute RPC expects security group names or ids"},{"line_number":1587,"context_line":"            # not objects, so convert this to a list of names until we can"},{"line_number":1588,"context_line":"            # pass the objects."}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_3b1cf975","line":1585,"updated":"2020-01-02 16:53:44.000000000","message":"AFAICT, none of this is tested.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"e454cb6639c09987c8947c61f09efcd8de39c641","unresolved":false,"context_lines":[{"line_number":1582,"context_line":"                    self._cleanup_build_artifacts("},{"line_number":1583,"context_line":"                        context, exc, instances, build_requests, request_specs,"},{"line_number":1584,"context_line":"                        block_device_mapping, tags, cell_mapping_cache)"},{"line_number":1585,"context_line":""},{"line_number":1586,"context_line":"            # NOTE(danms): Compute RPC expects security group names or ids"},{"line_number":1587,"context_line":"            # not objects, so convert this to a list of names until we can"},{"line_number":1588,"context_line":"            # pass the objects."}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_7e8baa21","line":1585,"in_reply_to":"3fa7e38b_3b1cf975","updated":"2020-01-15 07:04:59.000000000","message":"Done","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"faa1d71ff475c4520ae46390e025c8e8c2106b9c","unresolved":false,"context_lines":[{"line_number":1615,"context_line":"        LOG.debug(\u0027Calling Cyborg to get ARQs. dp_name\u003d%s instance\u003d%s\u0027,"},{"line_number":1616,"context_line":"                  dp_name, instance.uuid)"},{"line_number":1617,"context_line":"        cyclient \u003d cyborg.get_client(context)"},{"line_number":1618,"context_line":"        arqs \u003d cyclient.create_arqs_and_match_resource_providers("},{"line_number":1619,"context_line":"            dp_name, resource_provider_mapping)"},{"line_number":1620,"context_line":"        LOG.debug(\u0027Got ARQs with resource provider mapping %s\u0027, arqs)"},{"line_number":1621,"context_line":""},{"line_number":1622,"context_line":"        bindings \u003d {arq[\u0027uuid\u0027]:"},{"line_number":1623,"context_line":"                       {\"hostname\": hostname,"},{"line_number":1624,"context_line":"                        \"device_rp_uuid\": arq[\u0027device_rp_uuid\u0027],"},{"line_number":1625,"context_line":"                        \"instance_uuid\": instance.uuid"},{"line_number":1626,"context_line":"                       }"},{"line_number":1627,"context_line":"                    for arq in arqs}"},{"line_number":1628,"context_line":"        # Initiate Cyborg binding asynchronously"},{"line_number":1629,"context_line":"        cyclient.bind_arqs(bindings\u003dbindings)"},{"line_number":1630,"context_line":""},{"line_number":1631,"context_line":"    @staticmethod"},{"line_number":1632,"context_line":"    def _map_instance_to_cell(context, instance, cell):"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_1b17bd56","line":1629,"range":{"start_line":1618,"start_character":0,"end_line":1629,"end_character":45},"updated":"2020-01-02 16:53:44.000000000","message":"AFAICT, none of this is tested for correctness (although it is *run*).","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"e454cb6639c09987c8947c61f09efcd8de39c641","unresolved":false,"context_lines":[{"line_number":1615,"context_line":"        LOG.debug(\u0027Calling Cyborg to get ARQs. dp_name\u003d%s instance\u003d%s\u0027,"},{"line_number":1616,"context_line":"                  dp_name, instance.uuid)"},{"line_number":1617,"context_line":"        cyclient \u003d cyborg.get_client(context)"},{"line_number":1618,"context_line":"        arqs \u003d cyclient.create_arqs_and_match_resource_providers("},{"line_number":1619,"context_line":"            dp_name, resource_provider_mapping)"},{"line_number":1620,"context_line":"        LOG.debug(\u0027Got ARQs with resource provider mapping %s\u0027, arqs)"},{"line_number":1621,"context_line":""},{"line_number":1622,"context_line":"        bindings \u003d {arq[\u0027uuid\u0027]:"},{"line_number":1623,"context_line":"                       {\"hostname\": hostname,"},{"line_number":1624,"context_line":"                        \"device_rp_uuid\": arq[\u0027device_rp_uuid\u0027],"},{"line_number":1625,"context_line":"                        \"instance_uuid\": instance.uuid"},{"line_number":1626,"context_line":"                       }"},{"line_number":1627,"context_line":"                    for arq in arqs}"},{"line_number":1628,"context_line":"        # Initiate Cyborg binding asynchronously"},{"line_number":1629,"context_line":"        cyclient.bind_arqs(bindings\u003dbindings)"},{"line_number":1630,"context_line":""},{"line_number":1631,"context_line":"    @staticmethod"},{"line_number":1632,"context_line":"    def _map_instance_to_cell(context, instance, cell):"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_beb60289","line":1629,"range":{"start_line":1618,"start_character":0,"end_line":1629,"end_character":45},"in_reply_to":"3fa7e38b_1b17bd56","updated":"2020-01-15 07:04:59.000000000","message":"Done","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a28b7f01e23fcfd8905bc030da75848c4960b239","unresolved":false,"context_lines":[{"line_number":836,"context_line":"            LOG.debug(\"Selected host: %s; Selected node: %s; Alternates: %s\","},{"line_number":837,"context_line":"                    host.service_host, host.nodename, alts, instance\u003dinstance)"},{"line_number":838,"context_line":""},{"line_number":839,"context_line":"            self.compute_rpcapi.build_and_run_instance(context,"},{"line_number":840,"context_line":"                    instance\u003dinstance, host\u003dhost.service_host, image\u003dimage,"},{"line_number":841,"context_line":"                    request_spec\u003dlocal_reqspec,"},{"line_number":842,"context_line":"                    filter_properties\u003dlocal_filter_props,"}],"source_content_type":"text/x-python","patch_set":62,"id":"3fa7e38b_f63fd320","line":839,"updated":"2020-02-18 15:06:04.000000000","message":"I\u0027m not sure how you think reschedules are working in this stack currently, so maybe I\u0027m missing something. You need to create/bind  here as well, just before we make this call to the compute, right?","commit_id":"49aaee48b61fe7dd26c0ee9978cccc3d4abfe707"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"c16d2208ad030a346a4e02412c979a82a56ae4f9","unresolved":false,"context_lines":[{"line_number":836,"context_line":"            LOG.debug(\"Selected host: %s; Selected node: %s; Alternates: %s\","},{"line_number":837,"context_line":"                    host.service_host, host.nodename, alts, instance\u003dinstance)"},{"line_number":838,"context_line":""},{"line_number":839,"context_line":"            self.compute_rpcapi.build_and_run_instance(context,"},{"line_number":840,"context_line":"                    instance\u003dinstance, host\u003dhost.service_host, image\u003dimage,"},{"line_number":841,"context_line":"                    request_spec\u003dlocal_reqspec,"},{"line_number":842,"context_line":"                    filter_properties\u003dlocal_filter_props,"}],"source_content_type":"text/x-python","patch_set":62,"id":"1fa4df85_46d17457","line":839,"in_reply_to":"3fa7e38b_f63fd320","updated":"2020-02-23 08:28:40.000000000","message":"As we discussed on IRC, I was thinking of doing in a later patch. But, after discussion, I have changed this patch and the \u0027Bump RPCAPI\u0027 patch (https://review.opendev.org/704227) to handle creation.","commit_id":"49aaee48b61fe7dd26c0ee9978cccc3d4abfe707"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d30c6cbccef13dae3532df183e36e7969f7ef3c0","unresolved":false,"context_lines":[{"line_number":844,"context_line":"                    host.nodename, resource_provider_mapping)"},{"line_number":845,"context_line":"            except Exception as exc:"},{"line_number":846,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027,"},{"line_number":847,"context_line":"                              six.text_type(exc))"},{"line_number":848,"context_line":"                self._destroy_build_request(context, instance)"},{"line_number":849,"context_line":""},{"line_number":850,"context_line":"            self.compute_rpcapi.build_and_run_instance(context,"}],"source_content_type":"text/x-python","patch_set":63,"id":"1fa4df85_954b0286","line":847,"range":{"start_line":847,"start_character":30,"end_line":847,"end_character":43},"updated":"2020-02-24 17:02:10.000000000","message":"We don\u0027t do this anymore because we dropped py2 support, AFAIK.","commit_id":"6e308032ae2433f9916a9189344e44bd849c4e15"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"68e16151d5cce9aca19238f36f443f2bf37ec3cc","unresolved":false,"context_lines":[{"line_number":844,"context_line":"                    host.nodename, resource_provider_mapping)"},{"line_number":845,"context_line":"            except Exception as exc:"},{"line_number":846,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027,"},{"line_number":847,"context_line":"                              six.text_type(exc))"},{"line_number":848,"context_line":"                self._destroy_build_request(context, instance)"},{"line_number":849,"context_line":""},{"line_number":850,"context_line":"            self.compute_rpcapi.build_and_run_instance(context,"}],"source_content_type":"text/x-python","patch_set":63,"id":"1fa4df85_6b8679de","line":847,"range":{"start_line":847,"start_character":30,"end_line":847,"end_character":43},"in_reply_to":"1fa4df85_954b0286","updated":"2020-03-01 19:43:08.000000000","message":"Done","commit_id":"6e308032ae2433f9916a9189344e44bd849c4e15"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d815efa1a127d4328a56cb3393cd9e6ad7dfc26b","unresolved":false,"context_lines":[{"line_number":845,"context_line":"            except Exception as exc:"},{"line_number":846,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027,"},{"line_number":847,"context_line":"                              six.text_type(exc))"},{"line_number":848,"context_line":"                self._destroy_build_request(context, instance)"},{"line_number":849,"context_line":""},{"line_number":850,"context_line":"            self.compute_rpcapi.build_and_run_instance(context,"},{"line_number":851,"context_line":"                    instance\u003dinstance, host\u003dhost.service_host, image\u003dimage,"}],"source_content_type":"text/x-python","patch_set":63,"id":"1fa4df85_952782b7","line":848,"range":{"start_line":848,"start_character":16,"end_line":848,"end_character":62},"updated":"2020-02-24 16:10:40.000000000","message":"Why did you add this here? AFAIK, the BR should always already be gone by the time we get here. I think reschedule from the compute node is the only way we can have gotten here nowadays, and so the BR is already gone and replaced with an instance mapping. Even still, you\u0027re not handling the expect-able failure that this can raise. So I\u0027m guessing you added this for some reason -- can you explain?\n\nAlso, you\u0027re not actually stopping here, which means you\u0027ll continue on with the build_and_run() call below even if we fail to create/bind. Don\u0027t you want to do a continue here so we\u0027ll move on to the next candidate host?","commit_id":"6e308032ae2433f9916a9189344e44bd849c4e15"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"277e6c451489b5d17b6124738064a279d7897170","unresolved":false,"context_lines":[{"line_number":845,"context_line":"            except Exception as exc:"},{"line_number":846,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027,"},{"line_number":847,"context_line":"                              six.text_type(exc))"},{"line_number":848,"context_line":"                self._destroy_build_request(context, instance)"},{"line_number":849,"context_line":""},{"line_number":850,"context_line":"            self.compute_rpcapi.build_and_run_instance(context,"},{"line_number":851,"context_line":"                    instance\u003dinstance, host\u003dhost.service_host, image\u003dimage,"}],"source_content_type":"text/x-python","patch_set":63,"id":"1fa4df85_1aeb3713","line":848,"range":{"start_line":848,"start_character":16,"end_line":848,"end_character":62},"in_reply_to":"1fa4df85_4e2fe2a0","updated":"2020-03-04 03:37:08.000000000","message":"+1, thanks update.","commit_id":"6e308032ae2433f9916a9189344e44bd849c4e15"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"8101138a57f625eb3b1b0d25711c65c199220d93","unresolved":false,"context_lines":[{"line_number":845,"context_line":"            except Exception as exc:"},{"line_number":846,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027,"},{"line_number":847,"context_line":"                              six.text_type(exc))"},{"line_number":848,"context_line":"                self._destroy_build_request(context, instance)"},{"line_number":849,"context_line":""},{"line_number":850,"context_line":"            self.compute_rpcapi.build_and_run_instance(context,"},{"line_number":851,"context_line":"                    instance\u003dinstance, host\u003dhost.service_host, image\u003dimage,"}],"source_content_type":"text/x-python","patch_set":63,"id":"1fa4df85_ca50be0d","line":848,"range":{"start_line":848,"start_character":16,"end_line":848,"end_character":62},"in_reply_to":"1fa4df85_54223aa6","updated":"2020-02-27 14:45:11.000000000","message":"By the time we pick the first host, the BR is gone as the instance has a mapping, right? So why would we ever have a build request here during reschedule? The BR is the thing that provides a placeholder until we\u0027ve chosen a cell. Once the cell is chosen, the alternates will all be within that cell, which is why we can go ahead and create the instance mapping for that cell, delete the BR and move on.","commit_id":"6e308032ae2433f9916a9189344e44bd849c4e15"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"40a1da4e59b9b7750fa3d4cff7b4456651ab6d71","unresolved":false,"context_lines":[{"line_number":845,"context_line":"            except Exception as exc:"},{"line_number":846,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027,"},{"line_number":847,"context_line":"                              six.text_type(exc))"},{"line_number":848,"context_line":"                self._destroy_build_request(context, instance)"},{"line_number":849,"context_line":""},{"line_number":850,"context_line":"            self.compute_rpcapi.build_and_run_instance(context,"},{"line_number":851,"context_line":"                    instance\u003dinstance, host\u003dhost.service_host, image\u003dimage,"}],"source_content_type":"text/x-python","patch_set":63,"id":"1fa4df85_d102bcb4","line":848,"range":{"start_line":848,"start_character":16,"end_line":848,"end_character":62},"in_reply_to":"1fa4df85_952782b7","updated":"2020-02-27 01:26:42.000000000","message":"Discuss the retry with Sundar about the reschedule a little.\n\nSo I\u0027m thinking whether we need to retry next candidate hosts.\n\nIf yes, then we should add this code to the loop at line 715. Otherwise, we should just error out the instance, and stop the reschedule.\n\n \u0027_create_and_bind_arqs\u0027 is calling some of Cyborg async API, which means it only failed due to the cyborg API can\u0027t access. It won\u0027t fail due to host side resources unavailable. So nothing wrong with the host. So it should be ok to error the instance since there is something wrong in the deployment or API server etc. But I also feel it is good to do retry, the cyborg API may just temporarily inaccessible, but that should be retry for the cyborg client, not the retry of whole reschedule.\n\nSo in the end, I mean we should error out the instance, and stop the retry logic.","commit_id":"6e308032ae2433f9916a9189344e44bd849c4e15"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"68e16151d5cce9aca19238f36f443f2bf37ec3cc","unresolved":false,"context_lines":[{"line_number":845,"context_line":"            except Exception as exc:"},{"line_number":846,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027,"},{"line_number":847,"context_line":"                              six.text_type(exc))"},{"line_number":848,"context_line":"                self._destroy_build_request(context, instance)"},{"line_number":849,"context_line":""},{"line_number":850,"context_line":"            self.compute_rpcapi.build_and_run_instance(context,"},{"line_number":851,"context_line":"                    instance\u003dinstance, host\u003dhost.service_host, image\u003dimage,"}],"source_content_type":"text/x-python","patch_set":63,"id":"1fa4df85_4e2fe2a0","line":848,"range":{"start_line":848,"start_character":16,"end_line":848,"end_character":62},"in_reply_to":"1fa4df85_ca50be0d","updated":"2020-03-01 19:43:08.000000000","message":"As discussed in IRC, the right way to do this is to call _cleanup_when_reschedule_fails(). Done.","commit_id":"6e308032ae2433f9916a9189344e44bd849c4e15"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"28ecaafb432874d3c9ffbb5a549fd29bbe416aa1","unresolved":false,"context_lines":[{"line_number":845,"context_line":"            except Exception as exc:"},{"line_number":846,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027,"},{"line_number":847,"context_line":"                              six.text_type(exc))"},{"line_number":848,"context_line":"                self._destroy_build_request(context, instance)"},{"line_number":849,"context_line":""},{"line_number":850,"context_line":"            self.compute_rpcapi.build_and_run_instance(context,"},{"line_number":851,"context_line":"                    instance\u003dinstance, host\u003dhost.service_host, image\u003dimage,"}],"source_content_type":"text/x-python","patch_set":63,"id":"1fa4df85_54223aa6","line":848,"range":{"start_line":848,"start_character":16,"end_line":848,"end_character":62},"in_reply_to":"1fa4df85_d102bcb4","updated":"2020-02-27 02:47:43.000000000","message":"If _create_and_bind_arqs() failed, we just need to \u0027continue\u0027 reschedule to the next host, we dont need to clean up the build_request, otherwise it will impact other resources.","commit_id":"6e308032ae2433f9916a9189344e44bd849c4e15"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6eaebb09d169b5c83b60e330286959b0e740144f","unresolved":false,"context_lines":[{"line_number":839,"context_line":"            try:"},{"line_number":840,"context_line":"                resource_provider_mapping \u003d ("},{"line_number":841,"context_line":"                    local_reqspec.get_request_group_mapping())"},{"line_number":842,"context_line":"                self._create_and_bind_arqs("},{"line_number":843,"context_line":"                    context, instance.uuid, instance.flavor.extra_specs,"},{"line_number":844,"context_line":"                    host.nodename, resource_provider_mapping)"},{"line_number":845,"context_line":"            except Exception as exc:"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_a7e1ab2c","line":842,"updated":"2020-03-04 14:25:17.000000000","message":"Do we need to re-create the ARQs as well? Not just rebind them to the new host? What will happen in Cyborg if we create ARQs for the same DB the second time?","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"cd157bf1019f7e268897eeb4d6b98ce5e47049fe","unresolved":false,"context_lines":[{"line_number":839,"context_line":"            try:"},{"line_number":840,"context_line":"                resource_provider_mapping \u003d ("},{"line_number":841,"context_line":"                    local_reqspec.get_request_group_mapping())"},{"line_number":842,"context_line":"                self._create_and_bind_arqs("},{"line_number":843,"context_line":"                    context, instance.uuid, instance.flavor.extra_specs,"},{"line_number":844,"context_line":"                    host.nodename, resource_provider_mapping)"},{"line_number":845,"context_line":"            except Exception as exc:"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_c07eb6ad","line":842,"in_reply_to":"1fa4df85_96626309","updated":"2020-03-10 17:17:27.000000000","message":"So, during re-schedule there will be two set of ARQs one for the first host that is failed and one for the second host we are re-scheduling to. Does nova clean up the first set of ARQs? \n//later\nAs far as I understand this cleanup will happen later in the series.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"65d58351bad22fa57836ac9400ede66b75b19654","unresolved":false,"context_lines":[{"line_number":839,"context_line":"            try:"},{"line_number":840,"context_line":"                resource_provider_mapping \u003d ("},{"line_number":841,"context_line":"                    local_reqspec.get_request_group_mapping())"},{"line_number":842,"context_line":"                self._create_and_bind_arqs("},{"line_number":843,"context_line":"                    context, instance.uuid, instance.flavor.extra_specs,"},{"line_number":844,"context_line":"                    host.nodename, resource_provider_mapping)"},{"line_number":845,"context_line":"            except Exception as exc:"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_96626309","line":842,"in_reply_to":"1fa4df85_a7e1ab2c","updated":"2020-03-08 23:24:35.000000000","message":"Cyborg\u0027s POST API to create ARQs (in an unbound state) would create a new set of ARQs for each call, even if the same device profile name is passed in, since that is a valid request. \n\nNova\u0027s current usage of these APIs couples creation and binding together, so that we don\u0027t leave unbound ARQs dangling behind. Perhaps, when we get to migration, we may allow unbinding from one host and re-binding the same ARQs to another host. But the current usage is to create/bind ARQs together. On a related note, Nova deletes the bound ARQs for an instance in a single call, leaving it to Cyborg to unbind before deletion.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6eaebb09d169b5c83b60e330286959b0e740144f","unresolved":false,"context_lines":[{"line_number":1619,"context_line":"            except Exception as exc:"},{"line_number":1620,"context_line":"                # If anything failed here we need to cleanup and bail out."},{"line_number":1621,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1622,"context_line":"                    self._cleanup_build_artifacts("},{"line_number":1623,"context_line":"                        context, exc, instances, build_requests, request_specs,"},{"line_number":1624,"context_line":"                        block_device_mapping, tags, cell_mapping_cache)"},{"line_number":1625,"context_line":""}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_d3db4579","line":1622,"updated":"2020-03-04 14:25:17.000000000","message":"Does _cleanup_build_artifacts() needs to clean up ARQs that was created by _create_and_bind_arqs()? The bind_arqs() can raise AcceleratorRequestOpFailed exception that means create was successful but bind failed","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"cd157bf1019f7e268897eeb4d6b98ce5e47049fe","unresolved":false,"context_lines":[{"line_number":1619,"context_line":"            except Exception as exc:"},{"line_number":1620,"context_line":"                # If anything failed here we need to cleanup and bail out."},{"line_number":1621,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1622,"context_line":"                    self._cleanup_build_artifacts("},{"line_number":1623,"context_line":"                        context, exc, instances, build_requests, request_specs,"},{"line_number":1624,"context_line":"                        block_device_mapping, tags, cell_mapping_cache)"},{"line_number":1625,"context_line":""}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_6047c278","line":1622,"in_reply_to":"1fa4df85_163433fb","updated":"2020-03-10 17:17:27.000000000","message":"If it is solved later in the series then I\u0027m OK.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"876b576e3cfe4780860469091e44c36fd145fcc1","unresolved":false,"context_lines":[{"line_number":1619,"context_line":"            except Exception as exc:"},{"line_number":1620,"context_line":"                # If anything failed here we need to cleanup and bail out."},{"line_number":1621,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1622,"context_line":"                    self._cleanup_build_artifacts("},{"line_number":1623,"context_line":"                        context, exc, instances, build_requests, request_specs,"},{"line_number":1624,"context_line":"                        block_device_mapping, tags, cell_mapping_cache)"},{"line_number":1625,"context_line":""}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_f713cc5a","line":1622,"in_reply_to":"1fa4df85_d3db4579","updated":"2020-03-04 14:42:36.000000000","message":"It does in the later patch that adds support for deleting ARQs. It\u0027s a little cart-before-the-horse, which is why we have the -2 on the bottom patch.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"65d58351bad22fa57836ac9400ede66b75b19654","unresolved":false,"context_lines":[{"line_number":1619,"context_line":"            except Exception as exc:"},{"line_number":1620,"context_line":"                # If anything failed here we need to cleanup and bail out."},{"line_number":1621,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1622,"context_line":"                    self._cleanup_build_artifacts("},{"line_number":1623,"context_line":"                        context, exc, instances, build_requests, request_specs,"},{"line_number":1624,"context_line":"                        block_device_mapping, tags, cell_mapping_cache)"},{"line_number":1625,"context_line":""}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_163433fb","line":1622,"in_reply_to":"1fa4df85_f713cc5a","updated":"2020-03-08 23:24:35.000000000","message":"Putting deletion before creation is also cart-before-the-horse. Putting all of them together will result in a giant patch.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"878bcc3b70095ef22ccce13cb3cdee21a87fc0ad","unresolved":false,"context_lines":[{"line_number":846,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027, exc)"},{"line_number":847,"context_line":"                self._cleanup_when_reschedule_fails(context, instance, exc,"},{"line_number":848,"context_line":"                     legacy_request_spec, requested_networks)"},{"line_number":849,"context_line":"                continue"},{"line_number":850,"context_line":""},{"line_number":851,"context_line":"            self.compute_rpcapi.build_and_run_instance(context,"},{"line_number":852,"context_line":"                    instance\u003dinstance, host\u003dhost.service_host, image\u003dimage,"}],"source_content_type":"text/x-python","patch_set":68,"id":"1fa4df85_076696c2","line":849,"range":{"start_line":849,"start_character":16,"end_line":849,"end_character":24},"updated":"2020-03-19 13:22:19.000000000","message":"emm...why this is \u0027continue\u0027, not \u0027return\u0027","commit_id":"70c6aa219043cf8dd05c4ff9c23dcbbf1c102b20"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"48cf720a576d07d6c684a9da38c660bd16f7e5e7","unresolved":false,"context_lines":[{"line_number":846,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027, exc)"},{"line_number":847,"context_line":"                self._cleanup_when_reschedule_fails(context, instance, exc,"},{"line_number":848,"context_line":"                     legacy_request_spec, requested_networks)"},{"line_number":849,"context_line":"                continue"},{"line_number":850,"context_line":""},{"line_number":851,"context_line":"            self.compute_rpcapi.build_and_run_instance(context,"},{"line_number":852,"context_line":"                    instance\u003dinstance, host\u003dhost.service_host, image\u003dimage,"}],"source_content_type":"text/x-python","patch_set":68,"id":"1fa4df85_72faa175","line":849,"range":{"start_line":849,"start_character":16,"end_line":849,"end_character":24},"in_reply_to":"1fa4df85_076696c2","updated":"2020-03-19 17:17:36.000000000","message":"For the same reason we continue above, like L775 because we need to continue on to the next host alternate.","commit_id":"70c6aa219043cf8dd05c4ff9c23dcbbf1c102b20"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"1494e24af62ec625ba5b35cd9947120bc5b590e1","unresolved":false,"context_lines":[{"line_number":846,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027, exc)"},{"line_number":847,"context_line":"                self._cleanup_when_reschedule_fails(context, instance, exc,"},{"line_number":848,"context_line":"                     legacy_request_spec, requested_networks)"},{"line_number":849,"context_line":"                continue"},{"line_number":850,"context_line":""},{"line_number":851,"context_line":"            self.compute_rpcapi.build_and_run_instance(context,"},{"line_number":852,"context_line":"                    instance\u003dinstance, host\u003dhost.service_host, image\u003dimage,"}],"source_content_type":"text/x-python","patch_set":68,"id":"1fa4df85_8e8cd1d7","line":849,"range":{"start_line":849,"start_character":16,"end_line":849,"end_character":24},"in_reply_to":"1fa4df85_72faa175","updated":"2020-03-20 08:03:35.000000000","message":"oh...right, thanks...\n\nThen another question... if the whole retry failed, then it is ok, the user should delete the instance, and then I guess arq will be removed by the way.\n\nBut if we failed at binding, then we try next host and sucess, but the previous arq doesn\u0027t clean up.","commit_id":"70c6aa219043cf8dd05c4ff9c23dcbbf1c102b20"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ccfa0cdd3603ffea5546f6af47f257eee02dc244","unresolved":false,"context_lines":[{"line_number":846,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027, exc)"},{"line_number":847,"context_line":"                self._cleanup_when_reschedule_fails(context, instance, exc,"},{"line_number":848,"context_line":"                     legacy_request_spec, requested_networks)"},{"line_number":849,"context_line":"                continue"},{"line_number":850,"context_line":""},{"line_number":851,"context_line":"            self.compute_rpcapi.build_and_run_instance(context,"},{"line_number":852,"context_line":"                    instance\u003dinstance, host\u003dhost.service_host, image\u003dimage,"}],"source_content_type":"text/x-python","patch_set":68,"id":"df33271e_2dc9f877","line":849,"range":{"start_line":849,"start_character":16,"end_line":849,"end_character":24},"in_reply_to":"1fa4df85_8e8cd1d7","updated":"2020-03-22 01:36:34.000000000","message":"Alex, we clean the ARQs in a subsequent patch, inside _cleanup_when_reschedule_fails() [1]. \n\n[1] https://review.opendev.org/gitweb?p\u003dopenstack/nova.git;f\u003dnova/conductor/manager.py;hb\u003drefs/changes/35/673735/45#l598","commit_id":"70c6aa219043cf8dd05c4ff9c23dcbbf1c102b20"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"c0e78795929e4b9cb23ea76989b8840844946d49","unresolved":false,"context_lines":[{"line_number":846,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027, exc)"},{"line_number":847,"context_line":"                self._cleanup_when_reschedule_fails(context, instance, exc,"},{"line_number":848,"context_line":"                     legacy_request_spec, requested_networks)"},{"line_number":849,"context_line":"                continue"},{"line_number":850,"context_line":""},{"line_number":851,"context_line":"            self.compute_rpcapi.build_and_run_instance(context,"},{"line_number":852,"context_line":"                    instance\u003dinstance, host\u003dhost.service_host, image\u003dimage,"}],"source_content_type":"text/x-python","patch_set":68,"id":"df33271e_d43c55c1","line":849,"range":{"start_line":849,"start_character":16,"end_line":849,"end_character":24},"in_reply_to":"df33271e_2dc9f877","updated":"2020-03-22 07:34:04.000000000","message":"oh...I remember I checked the later patch..I\u0027m blind again.","commit_id":"70c6aa219043cf8dd05c4ff9c23dcbbf1c102b20"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"10db37e3ab1119ef89dc577c60149130719ccc7d","unresolved":false,"context_lines":[{"line_number":1618,"context_line":"                    host.nodename, resource_provider_mapping)"},{"line_number":1619,"context_line":"            except Exception as exc:"},{"line_number":1620,"context_line":"                # If anything failed here we need to cleanup and bail out."},{"line_number":1621,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1622,"context_line":"                    self._cleanup_build_artifacts("},{"line_number":1623,"context_line":"                        context, exc, instances, build_requests, request_specs,"},{"line_number":1624,"context_line":"                        block_device_mapping, tags, cell_mapping_cache)"}],"source_content_type":"text/x-python","patch_set":68,"id":"1fa4df85_54198877","line":1621,"range":{"start_line":1621,"start_character":16,"end_line":1621,"end_character":59},"updated":"2020-03-20 08:09:16.000000000","message":"for the first boot, we failed directly, didn\u0027t try next host.\n\nSo...I\u0027m thinking maybe this is right. We shouldn\u0027t try next host.","commit_id":"70c6aa219043cf8dd05c4ff9c23dcbbf1c102b20"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"6ed48e71b65a48141e5d1b9ab22e3d6ea38ab250","unresolved":false,"context_lines":[{"line_number":1618,"context_line":"                    host.nodename, resource_provider_mapping)"},{"line_number":1619,"context_line":"            except Exception as exc:"},{"line_number":1620,"context_line":"                # If anything failed here we need to cleanup and bail out."},{"line_number":1621,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1622,"context_line":"                    self._cleanup_build_artifacts("},{"line_number":1623,"context_line":"                        context, exc, instances, build_requests, request_specs,"},{"line_number":1624,"context_line":"                        block_device_mapping, tags, cell_mapping_cache)"}],"source_content_type":"text/x-python","patch_set":68,"id":"df33271e_f972327c","line":1621,"range":{"start_line":1621,"start_character":16,"end_line":1621,"end_character":59},"in_reply_to":"1fa4df85_54198877","updated":"2020-03-22 01:40:16.000000000","message":"Not sure I follow this comment or your other comments on retrying. Let\u0027s discuss offline.","commit_id":"70c6aa219043cf8dd05c4ff9c23dcbbf1c102b20"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"945f08d9c48f18c32efe44229b39642d709b1c21","unresolved":false,"context_lines":[{"line_number":1618,"context_line":"                    host.nodename, resource_provider_mapping)"},{"line_number":1619,"context_line":"            except Exception as exc:"},{"line_number":1620,"context_line":"                # If anything failed here we need to cleanup and bail out."},{"line_number":1621,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1622,"context_line":"                    self._cleanup_build_artifacts("},{"line_number":1623,"context_line":"                        context, exc, instances, build_requests, request_specs,"},{"line_number":1624,"context_line":"                        block_device_mapping, tags, cell_mapping_cache)"}],"source_content_type":"text/x-python","patch_set":68,"id":"df33271e_477d27b0","line":1621,"range":{"start_line":1621,"start_character":16,"end_line":1621,"end_character":59},"in_reply_to":"df33271e_384aca26","updated":"2020-03-23 17:38:56.000000000","message":"yes a simple continue would keep the current instance broken and try to boot the next instance on the next host. I think this loop was never designed to try more than one host for an instance. Such logic can only be done in _schedule_instances() afaik. I\u0027m OK with the current implementation to bail out early.","commit_id":"70c6aa219043cf8dd05c4ff9c23dcbbf1c102b20"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1e462fe34c4ef9b2f2e7b25e0ba9e276feb63602","unresolved":false,"context_lines":[{"line_number":1618,"context_line":"                    host.nodename, resource_provider_mapping)"},{"line_number":1619,"context_line":"            except Exception as exc:"},{"line_number":1620,"context_line":"                # If anything failed here we need to cleanup and bail out."},{"line_number":1621,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1622,"context_line":"                    self._cleanup_build_artifacts("},{"line_number":1623,"context_line":"                        context, exc, instances, build_requests, request_specs,"},{"line_number":1624,"context_line":"                        block_device_mapping, tags, cell_mapping_cache)"}],"source_content_type":"text/x-python","patch_set":68,"id":"df33271e_384aca26","line":1621,"range":{"start_line":1621,"start_character":16,"end_line":1621,"end_character":59},"in_reply_to":"df33271e_74758998","updated":"2020-03-23 13:35:56.000000000","message":"Yeah, I think you\u0027re right, but I also think that maybe this is fundamentally mildly broken in this method already. For example, if we failed (with an exception) to create instance_bdms on L1590, we would abort the entire thing here.\n\nDoing a continue here would just move to the next instance in a multi-instance boot, not to the next host for this instance, AFAICT. Perhaps we should at least do that to avoid breaking all instances instead of just the first (like on L1609) but if I\u0027m reading this right, we wouldn\u0027t be able to move onto the next host for the current instance.","commit_id":"70c6aa219043cf8dd05c4ff9c23dcbbf1c102b20"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"c0e78795929e4b9cb23ea76989b8840844946d49","unresolved":false,"context_lines":[{"line_number":1618,"context_line":"                    host.nodename, resource_provider_mapping)"},{"line_number":1619,"context_line":"            except Exception as exc:"},{"line_number":1620,"context_line":"                # If anything failed here we need to cleanup and bail out."},{"line_number":1621,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1622,"context_line":"                    self._cleanup_build_artifacts("},{"line_number":1623,"context_line":"                        context, exc, instances, build_requests, request_specs,"},{"line_number":1624,"context_line":"                        block_device_mapping, tags, cell_mapping_cache)"}],"source_content_type":"text/x-python","patch_set":68,"id":"df33271e_74758998","line":1621,"range":{"start_line":1621,"start_character":16,"end_line":1621,"end_character":59},"in_reply_to":"df33271e_f972327c","updated":"2020-03-22 07:34:04.000000000","message":"Sorrry, I didn\u0027t make it clear. I mean for the first time boot the instance, we will fail the instance booting directly when create/bind arqs failed. But why will continue retry different hosts when we retry the scheduling.","commit_id":"70c6aa219043cf8dd05c4ff9c23dcbbf1c102b20"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"1494e24af62ec625ba5b35cd9947120bc5b590e1","unresolved":false,"context_lines":[{"line_number":1666,"context_line":"                       }"},{"line_number":1667,"context_line":"                    for arq in arqs}"},{"line_number":1668,"context_line":"        # Initiate Cyborg binding asynchronously"},{"line_number":1669,"context_line":"        cyclient.bind_arqs(bindings\u003dbindings)"},{"line_number":1670,"context_line":""},{"line_number":1671,"context_line":"    @staticmethod"},{"line_number":1672,"context_line":"    def _map_instance_to_cell(context, instance, cell):"}],"source_content_type":"text/x-python","patch_set":68,"id":"1fa4df85_d9429168","line":1669,"range":{"start_line":1669,"start_character":8,"end_line":1669,"end_character":45},"updated":"2020-03-20 08:03:35.000000000","message":"we probably need to cleanup the arq at here.","commit_id":"70c6aa219043cf8dd05c4ff9c23dcbbf1c102b20"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ccfa0cdd3603ffea5546f6af47f257eee02dc244","unresolved":false,"context_lines":[{"line_number":1666,"context_line":"                       }"},{"line_number":1667,"context_line":"                    for arq in arqs}"},{"line_number":1668,"context_line":"        # Initiate Cyborg binding asynchronously"},{"line_number":1669,"context_line":"        cyclient.bind_arqs(bindings\u003dbindings)"},{"line_number":1670,"context_line":""},{"line_number":1671,"context_line":"    @staticmethod"},{"line_number":1672,"context_line":"    def _map_instance_to_cell(context, instance, cell):"}],"source_content_type":"text/x-python","patch_set":68,"id":"df33271e_cd904c52","line":1669,"range":{"start_line":1669,"start_character":8,"end_line":1669,"end_character":45},"in_reply_to":"1fa4df85_d9429168","updated":"2020-03-22 01:36:34.000000000","message":"Please see previous comment.","commit_id":"70c6aa219043cf8dd05c4ff9c23dcbbf1c102b20"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"52ea6779ffd607bc73a803887c69133297356a9e","unresolved":false,"context_lines":[{"line_number":844,"context_line":"                    host.nodename, resource_provider_mapping)"},{"line_number":845,"context_line":"            except Exception as exc:"},{"line_number":846,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027, exc)"},{"line_number":847,"context_line":"                self._cleanup_when_reschedule_fails(context, instance, exc,"},{"line_number":848,"context_line":"                     legacy_request_spec, requested_networks)"},{"line_number":849,"context_line":"                continue"},{"line_number":850,"context_line":""}],"source_content_type":"text/x-python","patch_set":69,"id":"df33271e_1f387ad1","line":847,"updated":"2020-03-24 12:46:39.000000000","message":"If we hit this exception, we should cleanup the created arqs info in Cyborg, otherwise the matched arqs in Cyborg will be occupided, and cannot matched by next request.","commit_id":"cc630b4eb62c4a45ff08a1862a8339a0f129e0a3"}],"nova/conf/compute.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b223f4d0583b0f4de2a6e7243b6c27636b35ae38","unresolved":false,"context_lines":[{"line_number":171,"context_line":"\"\"\"),"},{"line_number":172,"context_line":"    cfg.IntOpt(\u0027arq_binding_timeout\u0027,"},{"line_number":173,"context_line":"        default\u003d300,"},{"line_number":174,"context_line":"        min\u003d0,"},{"line_number":175,"context_line":"        help\u003d\"\"\""},{"line_number":176,"context_line":"Timeout for Accelerator Request (ARQ) bind event message arrival."},{"line_number":177,"context_line":""}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_2837f5b1","line":174,"updated":"2019-12-04 15:08:51.000000000","message":"I\u0027m not really sure that zero should be a valid value here. Zero will mean we wait forever, which means if the event gets lost, we will have an instance stuck in the parallel build queue until service restart with no way of unfreeing it. The vif timeout has a zero value to signal something else (not waiting at all) for legacy reasons. I think this should probably be min\u003d1.","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"14c3bb47bd071a2e4542f5530e7a25f25f235769","unresolved":false,"context_lines":[{"line_number":171,"context_line":"\"\"\"),"},{"line_number":172,"context_line":"    cfg.IntOpt(\u0027arq_binding_timeout\u0027,"},{"line_number":173,"context_line":"        default\u003d300,"},{"line_number":174,"context_line":"        min\u003d0,"},{"line_number":175,"context_line":"        help\u003d\"\"\""},{"line_number":176,"context_line":"Timeout for Accelerator Request (ARQ) bind event message arrival."},{"line_number":177,"context_line":""}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_aa8f402c","line":174,"in_reply_to":"3fa7e38b_2837f5b1","updated":"2019-12-09 03:50:21.000000000","message":"Done","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":29745,"name":"Dustin Cowles","email":"cowlesd@gmail.com","username":"dustinc","status":"inactive"},"change_message_id":"8a2824dbe2b4f533484cdf87d2c933ff4dac58c2","unresolved":false,"context_lines":[{"line_number":180,"context_line":"successfully or failed to bind. If it does not arrive, instance bringup"},{"line_number":181,"context_line":"is aborted with an exception."},{"line_number":182,"context_line":"\"\"\""},{"line_number":183,"context_line":"    ),"},{"line_number":184,"context_line":"    cfg.StrOpt(\u0027injected_network_template\u0027,"},{"line_number":185,"context_line":"        default\u003dpaths.basedir_def(\u0027nova/virt/interfaces.template\u0027),"},{"line_number":186,"context_line":"        help\u003d\"\"\"Path to \u0027/etc/network/interfaces\u0027 template."}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_fd2992f0","line":183,"updated":"2019-12-24 19:32:45.000000000","message":"nit: the rest of this file closes on the same line the comment ends","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"e454cb6639c09987c8947c61f09efcd8de39c641","unresolved":false,"context_lines":[{"line_number":180,"context_line":"successfully or failed to bind. If it does not arrive, instance bringup"},{"line_number":181,"context_line":"is aborted with an exception."},{"line_number":182,"context_line":"\"\"\""},{"line_number":183,"context_line":"    ),"},{"line_number":184,"context_line":"    cfg.StrOpt(\u0027injected_network_template\u0027,"},{"line_number":185,"context_line":"        default\u003dpaths.basedir_def(\u0027nova/virt/interfaces.template\u0027),"},{"line_number":186,"context_line":"        help\u003d\"\"\"Path to \u0027/etc/network/interfaces\u0027 template."}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_fe4a3a80","line":183,"in_reply_to":"3fa7e38b_5b6f7528","updated":"2020-01-15 07:04:59.000000000","message":"Done","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"faa1d71ff475c4520ae46390e025c8e8c2106b9c","unresolved":false,"context_lines":[{"line_number":180,"context_line":"successfully or failed to bind. If it does not arrive, instance bringup"},{"line_number":181,"context_line":"is aborted with an exception."},{"line_number":182,"context_line":"\"\"\""},{"line_number":183,"context_line":"    ),"},{"line_number":184,"context_line":"    cfg.StrOpt(\u0027injected_network_template\u0027,"},{"line_number":185,"context_line":"        default\u003dpaths.basedir_def(\u0027nova/virt/interfaces.template\u0027),"},{"line_number":186,"context_line":"        help\u003d\"\"\"Path to \u0027/etc/network/interfaces\u0027 template."}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_5b6f7528","line":183,"in_reply_to":"3fa7e38b_fd2992f0","updated":"2020-01-02 16:53:44.000000000","message":"This is not a nit, and definitely needs fixing :)","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"}],"nova/tests/fixtures.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6eaebb09d169b5c83b60e330286959b0e740144f","unresolved":false,"context_lines":[{"line_number":2579,"context_line":"    # }"},{"line_number":2580,"context_line":"    # Since it is indexed by instance UUID, and that is presumably unique"},{"line_number":2581,"context_line":"    # across concurrently executing tests, this should be safe for"},{"line_number":2582,"context_line":"    # concurrent access."},{"line_number":2583,"context_line":"    bindings_by_instance \u003d {}"},{"line_number":2584,"context_line":""},{"line_number":2585,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_b3756966","line":2582,"updated":"2020-03-04 14:25:17.000000000","message":"There are not real concurrency in our func and unit test envs between test cases. There are multiple parallel test executor processes but they have independent python interpreters. In a single process one test runs at a time. For each test the fixtures are re-created initialized.  Anyhow indexing by instance_uuid is OK to me.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6eaebb09d169b5c83b60e330286959b0e740144f","unresolved":false,"context_lines":[{"line_number":2603,"context_line":"                }"},{"line_number":2604,"context_line":"           :returns: None"},{"line_number":2605,"context_line":"        \"\"\""},{"line_number":2606,"context_line":"        binding_by_instance \u003d {}"},{"line_number":2607,"context_line":"        for index, arq_uuid in enumerate(bindings):"},{"line_number":2608,"context_line":"            arq_binding \u003d bindings[arq_uuid]"},{"line_number":2609,"context_line":"            # instance_uuid is same for all ARQs in a single call."}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_d3f7c5d2","line":2606,"range":{"start_line":2606,"start_character":30,"end_line":2606,"end_character":32},"updated":"2020-03-04 14:25:17.000000000","message":"By using collections.defaultdict(list) you could avoid the conditional at L2616","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"65d58351bad22fa57836ac9400ede66b75b19654","unresolved":false,"context_lines":[{"line_number":2603,"context_line":"                }"},{"line_number":2604,"context_line":"           :returns: None"},{"line_number":2605,"context_line":"        \"\"\""},{"line_number":2606,"context_line":"        binding_by_instance \u003d {}"},{"line_number":2607,"context_line":"        for index, arq_uuid in enumerate(bindings):"},{"line_number":2608,"context_line":"            arq_binding \u003d bindings[arq_uuid]"},{"line_number":2609,"context_line":"            # instance_uuid is same for all ARQs in a single call."}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_3637ef01","line":2606,"range":{"start_line":2606,"start_character":30,"end_line":2606,"end_character":32},"in_reply_to":"1fa4df85_d3f7c5d2","updated":"2020-03-08 23:24:35.000000000","message":"Done","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"}],"nova/tests/functional/test_servers.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"faa1d71ff475c4520ae46390e025c8e8c2106b9c","unresolved":false,"context_lines":[{"line_number":7413,"context_line":""},{"line_number":7414,"context_line":"        expected_rp_uuids \u003d [self.compute1_rp_uuid, self.device_rp_uuid]"},{"line_number":7415,"context_line":"        self.assertIn(alloc_rp_uuids[0], expected_rp_uuids)"},{"line_number":7416,"context_line":"        self.assertIn(alloc_rp_uuids[1], expected_rp_uuids)"},{"line_number":7417,"context_line":""},{"line_number":7418,"context_line":"        device_rp_alloc \u003d allocs[self.device_rp_uuid]"},{"line_number":7419,"context_line":"        self.assertEqual(device_rp_alloc[\u0027resources\u0027][\u0027FPGA\u0027], 1)"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_db54c558","line":7416,"updated":"2020-01-02 16:53:44.000000000","message":"shouldn\u0027t we just compare sorted(alloc_rp_uuids) to sorted(expeted_rp_uuids) to avoid false test failures due to sequencing?","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"e454cb6639c09987c8947c61f09efcd8de39c641","unresolved":false,"context_lines":[{"line_number":7413,"context_line":""},{"line_number":7414,"context_line":"        expected_rp_uuids \u003d [self.compute1_rp_uuid, self.device_rp_uuid]"},{"line_number":7415,"context_line":"        self.assertIn(alloc_rp_uuids[0], expected_rp_uuids)"},{"line_number":7416,"context_line":"        self.assertIn(alloc_rp_uuids[1], expected_rp_uuids)"},{"line_number":7417,"context_line":""},{"line_number":7418,"context_line":"        device_rp_alloc \u003d allocs[self.device_rp_uuid]"},{"line_number":7419,"context_line":"        self.assertEqual(device_rp_alloc[\u0027resources\u0027][\u0027FPGA\u0027], 1)"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_de13be67","line":7416,"in_reply_to":"3fa7e38b_db54c558","updated":"2020-01-15 07:04:59.000000000","message":"They are logically equivalent: order doesn\u0027t matter because I am doing assertIn.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"59972f9bfeb33055cf27ccb66e1ec3ba050c9a65","unresolved":false,"context_lines":[{"line_number":7413,"context_line":""},{"line_number":7414,"context_line":"        expected_rp_uuids \u003d [self.compute1_rp_uuid, self.device_rp_uuid]"},{"line_number":7415,"context_line":"        self.assertIn(alloc_rp_uuids[0], expected_rp_uuids)"},{"line_number":7416,"context_line":"        self.assertIn(alloc_rp_uuids[1], expected_rp_uuids)"},{"line_number":7417,"context_line":""},{"line_number":7418,"context_line":"        device_rp_alloc \u003d allocs[self.device_rp_uuid]"},{"line_number":7419,"context_line":"        self.assertEqual(device_rp_alloc[\u0027resources\u0027][\u0027FPGA\u0027], 1)"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_e10853d9","line":7416,"in_reply_to":"3fa7e38b_de13be67","updated":"2020-01-15 14:52:27.000000000","message":"Only because you\u0027re asserting the length on 7412, but I see that now.\n\nEither way, you can make one assertion of equality or three assertions of length, contains, contains. I\u0027d prefer the one, but agree that all three cover it.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"de51d74be4f298607f844c9eaf62341543b88a8a","unresolved":false,"context_lines":[{"line_number":7413,"context_line":""},{"line_number":7414,"context_line":"        expected_rp_uuids \u003d [self.compute1_rp_uuid, self.device_rp_uuid]"},{"line_number":7415,"context_line":"        self.assertIn(alloc_rp_uuids[0], expected_rp_uuids)"},{"line_number":7416,"context_line":"        self.assertIn(alloc_rp_uuids[1], expected_rp_uuids)"},{"line_number":7417,"context_line":""},{"line_number":7418,"context_line":"        device_rp_alloc \u003d allocs[self.device_rp_uuid]"},{"line_number":7419,"context_line":"        self.assertEqual(device_rp_alloc[\u0027resources\u0027][\u0027FPGA\u0027], 1)"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_24f9991b","line":7416,"in_reply_to":"3fa7e38b_e10853d9","updated":"2020-01-15 15:16:13.000000000","message":"OK, I am not wedded to either one, and I agree a single line is simpler. Will change.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"618a11eddb87ba9bc20084387236cdb302e4091f","unresolved":false,"context_lines":[{"line_number":7609,"context_line":"            self.cyborg.dp_name)"},{"line_number":7610,"context_line":"        arq_uuid \u003d self.cyborg.arq_list[0][\u0027uuid\u0027]"},{"line_number":7611,"context_line":"        bindings \u003d {arq_uuid:"},{"line_number":7612,"context_line":"            {\u0027hostname\u0027: mock.ANY,"},{"line_number":7613,"context_line":"             \u0027device_rp_uuid\u0027: self.device_rp_uuid,"},{"line_number":7614,"context_line":"             \u0027instance_uuid\u0027: server[\u0027id\u0027]"},{"line_number":7615,"context_line":"             }"}],"source_content_type":"text/x-python","patch_set":61,"id":"3fa7e38b_c8e5efa4","line":7612,"range":{"start_line":7612,"start_character":25,"end_line":7612,"end_character":33},"updated":"2020-02-07 17:17:34.000000000","message":"\"accel_host\" ?","commit_id":"234a66647303f08253eb7adb0c6696ac43bccb2a"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"940016f36ef01fd317ca3bf4a2b2775fa5ccd67c","unresolved":false,"context_lines":[{"line_number":7609,"context_line":"            self.cyborg.dp_name)"},{"line_number":7610,"context_line":"        arq_uuid \u003d self.cyborg.arq_list[0][\u0027uuid\u0027]"},{"line_number":7611,"context_line":"        bindings \u003d {arq_uuid:"},{"line_number":7612,"context_line":"            {\u0027hostname\u0027: mock.ANY,"},{"line_number":7613,"context_line":"             \u0027device_rp_uuid\u0027: self.device_rp_uuid,"},{"line_number":7614,"context_line":"             \u0027instance_uuid\u0027: server[\u0027id\u0027]"},{"line_number":7615,"context_line":"             }"}],"source_content_type":"text/x-python","patch_set":61,"id":"3fa7e38b_960ef4d5","line":7612,"range":{"start_line":7612,"start_character":25,"end_line":7612,"end_character":33},"in_reply_to":"3fa7e38b_c8e5efa4","updated":"2020-02-13 00:03:44.000000000","message":"Done","commit_id":"234a66647303f08253eb7adb0c6696ac43bccb2a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"618a11eddb87ba9bc20084387236cdb302e4091f","unresolved":false,"context_lines":[{"line_number":7604,"context_line":"            image_uuid\u003d\u0027155d900f-4e14-4e4c-a73d-069cbf4541e6\u0027,"},{"line_number":7605,"context_line":"            networks\u003d\u0027none\u0027, expected_state\u003d\u0027ACTIVE\u0027)"},{"line_number":7606,"context_line":""},{"line_number":7607,"context_line":"        self.cyborg.mock_get_dp.assert_called_once_with(self.cyborg.dp_name)"},{"line_number":7608,"context_line":"        self.cyborg.mock_create_arqs.assert_called_once_with("},{"line_number":7609,"context_line":"            self.cyborg.dp_name)"},{"line_number":7610,"context_line":"        arq_uuid \u003d self.cyborg.arq_list[0][\u0027uuid\u0027]"},{"line_number":7611,"context_line":"        bindings \u003d {arq_uuid:"},{"line_number":7612,"context_line":"            {\u0027hostname\u0027: mock.ANY,"},{"line_number":7613,"context_line":"             \u0027device_rp_uuid\u0027: self.device_rp_uuid,"},{"line_number":7614,"context_line":"             \u0027instance_uuid\u0027: server[\u0027id\u0027]"},{"line_number":7615,"context_line":"             }"},{"line_number":7616,"context_line":"        }"},{"line_number":7617,"context_line":"        self.cyborg.mock_bind_arqs.assert_called_once_with(bindings\u003dbindings)"},{"line_number":7618,"context_line":"        self.cyborg.mock_get_arqs.assert_has_calls(["},{"line_number":7619,"context_line":"            mock.call(server[\u0027id\u0027]),"},{"line_number":7620,"context_line":"            mock.call(server[\u0027id\u0027], only_resolved\u003dTrue)"},{"line_number":7621,"context_line":"        ])"},{"line_number":7622,"context_line":""},{"line_number":7623,"context_line":"        # Check status, allocations and usage"},{"line_number":7624,"context_line":"        self._check_allocations_usage(server[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":61,"id":"3fa7e38b_63d73c52","line":7621,"range":{"start_line":7607,"start_character":0,"end_line":7621,"end_character":10},"updated":"2020-02-07 17:17:34.000000000","message":"I guess at this point we can even ask our cyborg fixture about the state of the arqs and assert that they are as expected. This way we can avoid mocks in the functional test and the test would not depend on the exact requests nova does to cyborg, it would only assert that the expected end state is reached.\n\nSomething like:\n\n        # Check that the ARQs are bound to the host the server is booted on\n        # and the associated to the proper resource provider\n        arqs \u003d self.cyborg.fake_get_arqs_for_instance(server[\u0027id\u0027])\n        self.assertEqual(1, len(arqs))\n        self.assertEqual(\u0027Bound\u0027, arqs[0][\u0027state\u0027])\n        self.assertEqual(self.device_rp_uuid, arqs[0][\u0027device_rp_uuid\u0027])\n        self.assertEqual(server[\u0027OS-EXT-SRV-ATTR:host\u0027], arqs[0][\u0027hostname\u0027])","commit_id":"234a66647303f08253eb7adb0c6696ac43bccb2a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d8a66fa3bad01ad05ad77b4b53a71fed8c1805e7","unresolved":false,"context_lines":[{"line_number":7604,"context_line":"            image_uuid\u003d\u0027155d900f-4e14-4e4c-a73d-069cbf4541e6\u0027,"},{"line_number":7605,"context_line":"            networks\u003d\u0027none\u0027, expected_state\u003d\u0027ACTIVE\u0027)"},{"line_number":7606,"context_line":""},{"line_number":7607,"context_line":"        self.cyborg.mock_get_dp.assert_called_once_with(self.cyborg.dp_name)"},{"line_number":7608,"context_line":"        self.cyborg.mock_create_arqs.assert_called_once_with("},{"line_number":7609,"context_line":"            self.cyborg.dp_name)"},{"line_number":7610,"context_line":"        arq_uuid \u003d self.cyborg.arq_list[0][\u0027uuid\u0027]"},{"line_number":7611,"context_line":"        bindings \u003d {arq_uuid:"},{"line_number":7612,"context_line":"            {\u0027hostname\u0027: mock.ANY,"},{"line_number":7613,"context_line":"             \u0027device_rp_uuid\u0027: self.device_rp_uuid,"},{"line_number":7614,"context_line":"             \u0027instance_uuid\u0027: server[\u0027id\u0027]"},{"line_number":7615,"context_line":"             }"},{"line_number":7616,"context_line":"        }"},{"line_number":7617,"context_line":"        self.cyborg.mock_bind_arqs.assert_called_once_with(bindings\u003dbindings)"},{"line_number":7618,"context_line":"        self.cyborg.mock_get_arqs.assert_has_calls(["},{"line_number":7619,"context_line":"            mock.call(server[\u0027id\u0027]),"},{"line_number":7620,"context_line":"            mock.call(server[\u0027id\u0027], only_resolved\u003dTrue)"},{"line_number":7621,"context_line":"        ])"},{"line_number":7622,"context_line":""},{"line_number":7623,"context_line":"        # Check status, allocations and usage"},{"line_number":7624,"context_line":"        self._check_allocations_usage(server[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":61,"id":"3fa7e38b_bc83fca9","line":7621,"range":{"start_line":7607,"start_character":0,"end_line":7621,"end_character":10},"in_reply_to":"3fa7e38b_63d73c52","updated":"2020-02-10 15:20:19.000000000","message":"It turns out that the first two assert checks for things that are currently hardcoded in the fixture. So it might enough to have the last two asserts in place.","commit_id":"234a66647303f08253eb7adb0c6696ac43bccb2a"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"940016f36ef01fd317ca3bf4a2b2775fa5ccd67c","unresolved":false,"context_lines":[{"line_number":7604,"context_line":"            image_uuid\u003d\u0027155d900f-4e14-4e4c-a73d-069cbf4541e6\u0027,"},{"line_number":7605,"context_line":"            networks\u003d\u0027none\u0027, expected_state\u003d\u0027ACTIVE\u0027)"},{"line_number":7606,"context_line":""},{"line_number":7607,"context_line":"        self.cyborg.mock_get_dp.assert_called_once_with(self.cyborg.dp_name)"},{"line_number":7608,"context_line":"        self.cyborg.mock_create_arqs.assert_called_once_with("},{"line_number":7609,"context_line":"            self.cyborg.dp_name)"},{"line_number":7610,"context_line":"        arq_uuid \u003d self.cyborg.arq_list[0][\u0027uuid\u0027]"},{"line_number":7611,"context_line":"        bindings \u003d {arq_uuid:"},{"line_number":7612,"context_line":"            {\u0027hostname\u0027: mock.ANY,"},{"line_number":7613,"context_line":"             \u0027device_rp_uuid\u0027: self.device_rp_uuid,"},{"line_number":7614,"context_line":"             \u0027instance_uuid\u0027: server[\u0027id\u0027]"},{"line_number":7615,"context_line":"             }"},{"line_number":7616,"context_line":"        }"},{"line_number":7617,"context_line":"        self.cyborg.mock_bind_arqs.assert_called_once_with(bindings\u003dbindings)"},{"line_number":7618,"context_line":"        self.cyborg.mock_get_arqs.assert_has_calls(["},{"line_number":7619,"context_line":"            mock.call(server[\u0027id\u0027]),"},{"line_number":7620,"context_line":"            mock.call(server[\u0027id\u0027], only_resolved\u003dTrue)"},{"line_number":7621,"context_line":"        ])"},{"line_number":7622,"context_line":""},{"line_number":7623,"context_line":"        # Check status, allocations and usage"},{"line_number":7624,"context_line":"        self._check_allocations_usage(server[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":61,"id":"3fa7e38b_36cf008c","line":7621,"range":{"start_line":7607,"start_character":0,"end_line":7621,"end_character":10},"in_reply_to":"3fa7e38b_bc83fca9","updated":"2020-02-13 00:03:44.000000000","message":"Done","commit_id":"234a66647303f08253eb7adb0c6696ac43bccb2a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"618a11eddb87ba9bc20084387236cdb302e4091f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":61,"id":"3fa7e38b_e35a4cf3","line":7625,"updated":"2020-02-07 17:17:34.000000000","message":"Wouldn\u0027t we need to cover the case when scheduling succeeds but resource claim fails on the target host and therefore nova will re-schedule to build to an alternate host? Is this out of scope? Does nova at least handle states of the ARQs properly even if reschedule will fail?","commit_id":"234a66647303f08253eb7adb0c6696ac43bccb2a"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"940016f36ef01fd317ca3bf4a2b2775fa5ccd67c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":61,"id":"3fa7e38b_eece698d","line":7625,"in_reply_to":"3fa7e38b_55dd046c","updated":"2020-02-13 00:03:44.000000000","message":"Thanks, gibi. I added code in a later patch [1]  to delete the ARQs on a reschedule, so that they can be created and bound again on the new target node. \n\n[1] https://review.opendev.org/673735","commit_id":"234a66647303f08253eb7adb0c6696ac43bccb2a"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"c16d2208ad030a346a4e02412c979a82a56ae4f9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":61,"id":"1fa4df85_c6db247b","line":7625,"in_reply_to":"3fa7e38b_8a92fdab","updated":"2020-02-23 08:28:40.000000000","message":"Done","commit_id":"234a66647303f08253eb7adb0c6696ac43bccb2a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6d53746240bb2b2c6b26223146a5297f78eb7d1c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":61,"id":"3fa7e38b_55dd046c","line":7625,"in_reply_to":"3fa7e38b_e35a4cf3","updated":"2020-02-10 08:45:12.000000000","message":"\u003e Wouldn\u0027t we need to cover the case when scheduling succeeds but\n \u003e resource claim fails on the target host and therefore nova will\n \u003e re-schedule to build to an alternate host? Is this out of scope?\n \u003e Does nova at least handle states of the ARQs properly even if\n \u003e reschedule will fail?\n\nMy first goal here would be to see what happens if a re-schedule is triggered. A test similar to [1] with ARQs would serve that goal. \n\nHonestly I cannot guess that what I did for the qos + reschedule is enough for the ARQ case or not. But if it is not then my original patch might help figuring out which part of the code needs to be debugged. [2]\n\n\n[1] nova.tests.functional.test_servers.PortResourceRequestReSchedulingTest.test_boot_reschedule_success\n\n[2] https://review.opendev.org/#/c/619529/","commit_id":"234a66647303f08253eb7adb0c6696ac43bccb2a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d76f34b3b413c2b67fc08d5e138774aeeab703b8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":61,"id":"3fa7e38b_236e2465","line":7625,"in_reply_to":"3fa7e38b_e35a4cf3","updated":"2020-02-07 17:33:00.000000000","message":"Also as soon as we allow booting an instance with ARQs we need to make sure that all the not yet supported operations on such instance (e.g. migrate) are gracefully rejected instead resulting in obscure errors, or in data corruption.","commit_id":"234a66647303f08253eb7adb0c6696ac43bccb2a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a916bf45ce370e1be2e9a848942ca42c2f0e41b9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":61,"id":"3fa7e38b_8a92fdab","line":7625,"in_reply_to":"3fa7e38b_eece698d","updated":"2020-02-18 09:06:04.000000000","message":"@Sundar, could you add two functional test cases covering the two re-schedule scenario to [1]. 1) re-schedule success on the second host 2) re-schedule fails on every available host so the server create fails","commit_id":"234a66647303f08253eb7adb0c6696ac43bccb2a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a916bf45ce370e1be2e9a848942ca42c2f0e41b9","unresolved":false,"context_lines":[{"line_number":7604,"context_line":"            image_uuid\u003d\u0027155d900f-4e14-4e4c-a73d-069cbf4541e6\u0027,"},{"line_number":7605,"context_line":"            networks\u003d\u0027none\u0027, expected_state\u003d\u0027ACTIVE\u0027)"},{"line_number":7606,"context_line":""},{"line_number":7607,"context_line":"        self.cyborg.mock_get_dp.assert_called_once_with(self.cyborg.dp_name)"},{"line_number":7608,"context_line":"        self.cyborg.mock_create_arqs.assert_called_once_with("},{"line_number":7609,"context_line":"            self.cyborg.dp_name)"},{"line_number":7610,"context_line":"        arq_uuid \u003d self.cyborg.arq_list[0][\u0027uuid\u0027]"},{"line_number":7611,"context_line":"        bindings \u003d {arq_uuid:"},{"line_number":7612,"context_line":"            {\u0027hostname\u0027: \u0027accel_host\u0027,  # mock.ANY,"},{"line_number":7613,"context_line":"             \u0027device_rp_uuid\u0027: self.device_rp_uuid,"},{"line_number":7614,"context_line":"             \u0027instance_uuid\u0027: server[\u0027id\u0027]"},{"line_number":7615,"context_line":"             }"},{"line_number":7616,"context_line":"        }"},{"line_number":7617,"context_line":"        self.cyborg.mock_bind_arqs.assert_called_once_with(bindings\u003dbindings)"},{"line_number":7618,"context_line":"        self.cyborg.mock_get_arqs.assert_has_calls(["},{"line_number":7619,"context_line":"            mock.call(server[\u0027id\u0027]),"},{"line_number":7620,"context_line":"            mock.call(server[\u0027id\u0027], only_resolved\u003dTrue)"},{"line_number":7621,"context_line":"        ])"},{"line_number":7622,"context_line":"        # Verify that the host name and the device rp UUID are set properly."},{"line_number":7623,"context_line":"        # Other fields in the ARQ are hardcoded data from the fixture."},{"line_number":7624,"context_line":"        arqs \u003d self.cyborg.fake_get_arqs_for_instance(server[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":62,"id":"3fa7e38b_4a008500","line":7621,"range":{"start_line":7607,"start_character":0,"end_line":7621,"end_character":10},"updated":"2020-02-18 09:06:04.000000000","message":"For me the below, newly added, asserts cover the functional behavior enough so the mocks can be removed from the functional test.\n\nCan be done in a follow up","commit_id":"49aaee48b61fe7dd26c0ee9978cccc3d4abfe707"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"c16d2208ad030a346a4e02412c979a82a56ae4f9","unresolved":false,"context_lines":[{"line_number":7604,"context_line":"            image_uuid\u003d\u0027155d900f-4e14-4e4c-a73d-069cbf4541e6\u0027,"},{"line_number":7605,"context_line":"            networks\u003d\u0027none\u0027, expected_state\u003d\u0027ACTIVE\u0027)"},{"line_number":7606,"context_line":""},{"line_number":7607,"context_line":"        self.cyborg.mock_get_dp.assert_called_once_with(self.cyborg.dp_name)"},{"line_number":7608,"context_line":"        self.cyborg.mock_create_arqs.assert_called_once_with("},{"line_number":7609,"context_line":"            self.cyborg.dp_name)"},{"line_number":7610,"context_line":"        arq_uuid \u003d self.cyborg.arq_list[0][\u0027uuid\u0027]"},{"line_number":7611,"context_line":"        bindings \u003d {arq_uuid:"},{"line_number":7612,"context_line":"            {\u0027hostname\u0027: \u0027accel_host\u0027,  # mock.ANY,"},{"line_number":7613,"context_line":"             \u0027device_rp_uuid\u0027: self.device_rp_uuid,"},{"line_number":7614,"context_line":"             \u0027instance_uuid\u0027: server[\u0027id\u0027]"},{"line_number":7615,"context_line":"             }"},{"line_number":7616,"context_line":"        }"},{"line_number":7617,"context_line":"        self.cyborg.mock_bind_arqs.assert_called_once_with(bindings\u003dbindings)"},{"line_number":7618,"context_line":"        self.cyborg.mock_get_arqs.assert_has_calls(["},{"line_number":7619,"context_line":"            mock.call(server[\u0027id\u0027]),"},{"line_number":7620,"context_line":"            mock.call(server[\u0027id\u0027], only_resolved\u003dTrue)"},{"line_number":7621,"context_line":"        ])"},{"line_number":7622,"context_line":"        # Verify that the host name and the device rp UUID are set properly."},{"line_number":7623,"context_line":"        # Other fields in the ARQ are hardcoded data from the fixture."},{"line_number":7624,"context_line":"        arqs \u003d self.cyborg.fake_get_arqs_for_instance(server[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":62,"id":"1fa4df85_e6d8a080","line":7621,"range":{"start_line":7607,"start_character":0,"end_line":7621,"end_character":10},"in_reply_to":"3fa7e38b_4a008500","updated":"2020-02-23 08:28:40.000000000","message":"Done","commit_id":"49aaee48b61fe7dd26c0ee9978cccc3d4abfe707"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"7850135da2591a42269fb0a11a9949c9108e1c53","unresolved":false,"context_lines":[{"line_number":7657,"context_line":"        allocs \u003d self._get_allocations_by_server_uuid(server_uuid)"},{"line_number":7658,"context_line":"        alloc_rp_uuids \u003d sorted(list(allocs))"},{"line_number":7659,"context_line":""},{"line_number":7660,"context_line":"        # Expected RPs are either (compute0, device0) or (compute1, device1)"},{"line_number":7661,"context_line":"        expected_rp_uuids \u003d ["},{"line_number":7662,"context_line":"            sorted([self.compute_rp_uuids[i], self.device_rp_uuids[i]])"},{"line_number":7663,"context_line":"            for i in range(self.NUM_HOSTS)]"},{"line_number":7664,"context_line":"        self.assertIn(alloc_rp_uuids, expected_rp_uuids)"},{"line_number":7665,"context_line":""},{"line_number":7666,"context_line":"        # Find which host/device combi got selected"},{"line_number":7667,"context_line":"        idx \u003d expected_rp_uuids.index(alloc_rp_uuids)"}],"source_content_type":"text/x-python","patch_set":63,"id":"1fa4df85_4f2660ba","line":7664,"range":{"start_line":7660,"start_character":0,"end_line":7664,"end_character":56},"updated":"2020-02-24 10:19:36.000000000","message":"This is a too forgiving assert. It passes if there is allocation in either of the compute hosts but we need to assert that that the allocation is on the host where the instance is running.","commit_id":"6e308032ae2433f9916a9189344e44bd849c4e15"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"68e16151d5cce9aca19238f36f443f2bf37ec3cc","unresolved":false,"context_lines":[{"line_number":7657,"context_line":"        allocs \u003d self._get_allocations_by_server_uuid(server_uuid)"},{"line_number":7658,"context_line":"        alloc_rp_uuids \u003d sorted(list(allocs))"},{"line_number":7659,"context_line":""},{"line_number":7660,"context_line":"        # Expected RPs are either (compute0, device0) or (compute1, device1)"},{"line_number":7661,"context_line":"        expected_rp_uuids \u003d ["},{"line_number":7662,"context_line":"            sorted([self.compute_rp_uuids[i], self.device_rp_uuids[i]])"},{"line_number":7663,"context_line":"            for i in range(self.NUM_HOSTS)]"},{"line_number":7664,"context_line":"        self.assertIn(alloc_rp_uuids, expected_rp_uuids)"},{"line_number":7665,"context_line":""},{"line_number":7666,"context_line":"        # Find which host/device combi got selected"},{"line_number":7667,"context_line":"        idx \u003d expected_rp_uuids.index(alloc_rp_uuids)"}],"source_content_type":"text/x-python","patch_set":63,"id":"1fa4df85_2e1e2670","line":7664,"range":{"start_line":7660,"start_character":0,"end_line":7664,"end_character":56},"in_reply_to":"1fa4df85_4f2660ba","updated":"2020-03-01 19:43:08.000000000","message":"Done","commit_id":"6e308032ae2433f9916a9189344e44bd849c4e15"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ab243a11ce29d6c8ef29115d11538ad0072c1fff","unresolved":false,"context_lines":[{"line_number":7676,"context_line":"    def test_resched_fails(self):"},{"line_number":7677,"context_line":""},{"line_number":7678,"context_line":"        def throw_error(*args, **kwargs):"},{"line_number":7679,"context_line":"            raise exception.BuildAbortException(reason\u003d\u0027\u0027,"},{"line_number":7680,"context_line":"                    instance_uuid\u003d\u0027fake\u0027)"},{"line_number":7681,"context_line":""},{"line_number":7682,"context_line":"        self.stub_out(\u0027nova.virt.fake.FakeDriver.spawn\u0027, throw_error)"}],"source_content_type":"text/x-python","patch_set":63,"id":"1fa4df85_22e69bea","line":7679,"range":{"start_line":7679,"start_character":28,"end_line":7679,"end_character":47},"updated":"2020-02-24 12:08:51.000000000","message":"BuildAbortException does not trigger re-schedule. You should use something like ComputeResourcesUnavailable exception.","commit_id":"6e308032ae2433f9916a9189344e44bd849c4e15"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"68e16151d5cce9aca19238f36f443f2bf37ec3cc","unresolved":false,"context_lines":[{"line_number":7676,"context_line":"    def test_resched_fails(self):"},{"line_number":7677,"context_line":""},{"line_number":7678,"context_line":"        def throw_error(*args, **kwargs):"},{"line_number":7679,"context_line":"            raise exception.BuildAbortException(reason\u003d\u0027\u0027,"},{"line_number":7680,"context_line":"                    instance_uuid\u003d\u0027fake\u0027)"},{"line_number":7681,"context_line":""},{"line_number":7682,"context_line":"        self.stub_out(\u0027nova.virt.fake.FakeDriver.spawn\u0027, throw_error)"}],"source_content_type":"text/x-python","patch_set":63,"id":"1fa4df85_0b602501","line":7679,"range":{"start_line":7679,"start_character":28,"end_line":7679,"end_character":47},"in_reply_to":"1fa4df85_22e69bea","updated":"2020-03-01 19:43:08.000000000","message":"Done","commit_id":"6e308032ae2433f9916a9189344e44bd849c4e15"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ab243a11ce29d6c8ef29115d11538ad0072c1fff","unresolved":false,"context_lines":[{"line_number":7693,"context_line":"    def test_resched(self):"},{"line_number":7694,"context_line":""},{"line_number":7695,"context_line":"        def throw_error(*args, **kwargs):"},{"line_number":7696,"context_line":"            raise exception.BuildAbortException(reason\u003d\u0027\u0027,"},{"line_number":7697,"context_line":"                    instance_uuid\u003d\u0027fake\u0027)"},{"line_number":7698,"context_line":""},{"line_number":7699,"context_line":"        orig_spawn \u003d fake.FakeDriver.spawn"}],"source_content_type":"text/x-python","patch_set":63,"id":"1fa4df85_02c83f53","line":7696,"range":{"start_line":7696,"start_character":28,"end_line":7696,"end_character":47},"updated":"2020-02-24 12:08:51.000000000","message":"ditto","commit_id":"6e308032ae2433f9916a9189344e44bd849c4e15"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"68e16151d5cce9aca19238f36f443f2bf37ec3cc","unresolved":false,"context_lines":[{"line_number":7693,"context_line":"    def test_resched(self):"},{"line_number":7694,"context_line":""},{"line_number":7695,"context_line":"        def throw_error(*args, **kwargs):"},{"line_number":7696,"context_line":"            raise exception.BuildAbortException(reason\u003d\u0027\u0027,"},{"line_number":7697,"context_line":"                    instance_uuid\u003d\u0027fake\u0027)"},{"line_number":7698,"context_line":""},{"line_number":7699,"context_line":"        orig_spawn \u003d fake.FakeDriver.spawn"}],"source_content_type":"text/x-python","patch_set":63,"id":"1fa4df85_2b5ba154","line":7696,"range":{"start_line":7696,"start_character":28,"end_line":7696,"end_character":47},"in_reply_to":"1fa4df85_02c83f53","updated":"2020-03-01 19:43:08.000000000","message":"Done","commit_id":"6e308032ae2433f9916a9189344e44bd849c4e15"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"7850135da2591a42269fb0a11a9949c9108e1c53","unresolved":false,"context_lines":[{"line_number":7697,"context_line":"                    instance_uuid\u003d\u0027fake\u0027)"},{"line_number":7698,"context_line":""},{"line_number":7699,"context_line":"        orig_spawn \u003d fake.FakeDriver.spawn"},{"line_number":7700,"context_line":"        with mock.patch(\u0027nova.virt.fake.FakeDriver.spawn\u0027,"},{"line_number":7701,"context_line":"                        side_effect\u003d[throw_error, orig_spawn]):"},{"line_number":7702,"context_line":"            flavor_id \u003d self._create_acc_flavor()"},{"line_number":7703,"context_line":"            server_name \u003d \u0027accel_server1\u0027"},{"line_number":7704,"context_line":"            server \u003d self._create_server("}],"source_content_type":"text/x-python","patch_set":63,"id":"1fa4df85_ef3aaccb","line":7701,"range":{"start_line":7700,"start_character":0,"end_line":7701,"end_character":63},"updated":"2020-02-24 10:19:36.000000000","message":"I don\u0027t think it does what you wanted to do.\n\nWhen side_effect is an iterable then each call to the mocked function will _return_ the next _item_ from the iterable. But what you need here is to _call_ the next item not just return it.\nWe tend to do this with:\n\ndef fake_spawn(...):\n    if first_call:\n        return throw_error()\n    else:\n        orig_spawn\n\nwith mock.patch(\u0027..\u0027, side_effect\u003dfake_spawn):\n    ...","commit_id":"6e308032ae2433f9916a9189344e44bd849c4e15"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"1a8c0144e246fe6d38fd0ba9795095f33e4a3c58","unresolved":false,"context_lines":[{"line_number":7697,"context_line":"                    instance_uuid\u003d\u0027fake\u0027)"},{"line_number":7698,"context_line":""},{"line_number":7699,"context_line":"        orig_spawn \u003d fake.FakeDriver.spawn"},{"line_number":7700,"context_line":"        with mock.patch(\u0027nova.virt.fake.FakeDriver.spawn\u0027,"},{"line_number":7701,"context_line":"                        side_effect\u003d[throw_error, orig_spawn]):"},{"line_number":7702,"context_line":"            flavor_id \u003d self._create_acc_flavor()"},{"line_number":7703,"context_line":"            server_name \u003d \u0027accel_server1\u0027"},{"line_number":7704,"context_line":"            server \u003d self._create_server("}],"source_content_type":"text/x-python","patch_set":63,"id":"1fa4df85_87850ab0","line":7701,"range":{"start_line":7700,"start_character":0,"end_line":7701,"end_character":63},"in_reply_to":"1fa4df85_71621b19","updated":"2020-02-25 12:04:11.000000000","message":"Based on the logs this test case now does not trigger a reschedule","commit_id":"6e308032ae2433f9916a9189344e44bd849c4e15"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"68e16151d5cce9aca19238f36f443f2bf37ec3cc","unresolved":false,"context_lines":[{"line_number":7697,"context_line":"                    instance_uuid\u003d\u0027fake\u0027)"},{"line_number":7698,"context_line":""},{"line_number":7699,"context_line":"        orig_spawn \u003d fake.FakeDriver.spawn"},{"line_number":7700,"context_line":"        with mock.patch(\u0027nova.virt.fake.FakeDriver.spawn\u0027,"},{"line_number":7701,"context_line":"                        side_effect\u003d[throw_error, orig_spawn]):"},{"line_number":7702,"context_line":"            flavor_id \u003d self._create_acc_flavor()"},{"line_number":7703,"context_line":"            server_name \u003d \u0027accel_server1\u0027"},{"line_number":7704,"context_line":"            server \u003d self._create_server("}],"source_content_type":"text/x-python","patch_set":63,"id":"1fa4df85_ee17ae50","line":7701,"range":{"start_line":7700,"start_character":0,"end_line":7701,"end_character":63},"in_reply_to":"1fa4df85_87850ab0","updated":"2020-03-01 19:43:08.000000000","message":"Done","commit_id":"6e308032ae2433f9916a9189344e44bd849c4e15"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d815efa1a127d4328a56cb3393cd9e6ad7dfc26b","unresolved":false,"context_lines":[{"line_number":7697,"context_line":"                    instance_uuid\u003d\u0027fake\u0027)"},{"line_number":7698,"context_line":""},{"line_number":7699,"context_line":"        orig_spawn \u003d fake.FakeDriver.spawn"},{"line_number":7700,"context_line":"        with mock.patch(\u0027nova.virt.fake.FakeDriver.spawn\u0027,"},{"line_number":7701,"context_line":"                        side_effect\u003d[throw_error, orig_spawn]):"},{"line_number":7702,"context_line":"            flavor_id \u003d self._create_acc_flavor()"},{"line_number":7703,"context_line":"            server_name \u003d \u0027accel_server1\u0027"},{"line_number":7704,"context_line":"            server \u003d self._create_server("}],"source_content_type":"text/x-python","patch_set":63,"id":"1fa4df85_71621b19","line":7701,"range":{"start_line":7700,"start_character":0,"end_line":7701,"end_character":63},"in_reply_to":"1fa4df85_c2c1c730","updated":"2020-02-24 16:10:40.000000000","message":"Yep, agree here on using a new function to do the return in sequence.\n\nSo I think maybe what\u0027s happening with this test is that it\u0027s not actually rescheduling and since the assert is so loose (that it\u0027s on any compute?), we\u0027re not noticing?","commit_id":"6e308032ae2433f9916a9189344e44bd849c4e15"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ab243a11ce29d6c8ef29115d11538ad0072c1fff","unresolved":false,"context_lines":[{"line_number":7697,"context_line":"                    instance_uuid\u003d\u0027fake\u0027)"},{"line_number":7698,"context_line":""},{"line_number":7699,"context_line":"        orig_spawn \u003d fake.FakeDriver.spawn"},{"line_number":7700,"context_line":"        with mock.patch(\u0027nova.virt.fake.FakeDriver.spawn\u0027,"},{"line_number":7701,"context_line":"                        side_effect\u003d[throw_error, orig_spawn]):"},{"line_number":7702,"context_line":"            flavor_id \u003d self._create_acc_flavor()"},{"line_number":7703,"context_line":"            server_name \u003d \u0027accel_server1\u0027"},{"line_number":7704,"context_line":"            server \u003d self._create_server("}],"source_content_type":"text/x-python","patch_set":63,"id":"1fa4df85_c2c1c730","line":7701,"range":{"start_line":7700,"start_character":0,"end_line":7701,"end_character":63},"in_reply_to":"1fa4df85_ef3aaccb","updated":"2020-02-24 12:08:51.000000000","message":"due to an obscure function binding complication you actually need to use \n\n    with mock.patch(\u0027...\u0027, new\u003dfake_spawn)\n\ninstead of side_effect","commit_id":"6e308032ae2433f9916a9189344e44bd849c4e15"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"8fbd0e794e8c8e518d29e790a98e17395f8f54ba","unresolved":false,"context_lines":[{"line_number":7704,"context_line":""},{"line_number":7705,"context_line":"        host_rp_uuid \u003d self._get_provider_uuid_by_host("},{"line_number":7706,"context_line":"            server[\u0027OS-EXT-SRV-ATTR:host\u0027])"},{"line_number":7707,"context_line":"        device_rp_uuid \u003d ["},{"line_number":7708,"context_line":"           rp[\u0027uuid\u0027] for rp in self._get_all_providers()"},{"line_number":7709,"context_line":"           if rp[\u0027uuid\u0027] !\u003d rp[\u0027root_provider_uuid\u0027] and"},{"line_number":7710,"context_line":"           host_rp_uuid \u003d\u003d rp[\u0027root_provider_uuid\u0027]"},{"line_number":7711,"context_line":"        ][0]"},{"line_number":7712,"context_line":""},{"line_number":7713,"context_line":"        # Expected RPs are either (compute0, device0) or (compute1, device1)"},{"line_number":7714,"context_line":"        # We compare allocations on the host where the instance is scheduled."}],"source_content_type":"text/x-python","patch_set":64,"id":"1fa4df85_d6ea7caa","line":7711,"range":{"start_line":7707,"start_character":0,"end_line":7711,"end_character":12},"updated":"2020-03-02 15:45:59.000000000","message":"I would rather this be broken into multiple steps. If something changes and this fails, it will just generate an IndexError and be difficult to debug.","commit_id":"82b1f15613a2f8b51c95b3143a155910ba876f26"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"6495f655ae43682ad54e4bd9bd75deb62bf1c8df","unresolved":false,"context_lines":[{"line_number":7704,"context_line":""},{"line_number":7705,"context_line":"        host_rp_uuid \u003d self._get_provider_uuid_by_host("},{"line_number":7706,"context_line":"            server[\u0027OS-EXT-SRV-ATTR:host\u0027])"},{"line_number":7707,"context_line":"        device_rp_uuid \u003d ["},{"line_number":7708,"context_line":"           rp[\u0027uuid\u0027] for rp in self._get_all_providers()"},{"line_number":7709,"context_line":"           if rp[\u0027uuid\u0027] !\u003d rp[\u0027root_provider_uuid\u0027] and"},{"line_number":7710,"context_line":"           host_rp_uuid \u003d\u003d rp[\u0027root_provider_uuid\u0027]"},{"line_number":7711,"context_line":"        ][0]"},{"line_number":7712,"context_line":""},{"line_number":7713,"context_line":"        # Expected RPs are either (compute0, device0) or (compute1, device1)"},{"line_number":7714,"context_line":"        # We compare allocations on the host where the instance is scheduled."}],"source_content_type":"text/x-python","patch_set":64,"id":"1fa4df85_be031273","line":7711,"range":{"start_line":7707,"start_character":0,"end_line":7711,"end_character":12},"in_reply_to":"1fa4df85_d6ea7caa","updated":"2020-03-03 07:27:10.000000000","message":"Done","commit_id":"82b1f15613a2f8b51c95b3143a155910ba876f26"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"8fbd0e794e8c8e518d29e790a98e17395f8f54ba","unresolved":false,"context_lines":[{"line_number":7713,"context_line":"        # Expected RPs are either (compute0, device0) or (compute1, device1)"},{"line_number":7714,"context_line":"        # We compare allocations on the host where the instance is scheduled."},{"line_number":7715,"context_line":"        expected_rp_uuids \u003d sorted([host_rp_uuid, device_rp_uuid])"},{"line_number":7716,"context_line":"        self.assertEqual(alloc_rp_uuids, expected_rp_uuids)"},{"line_number":7717,"context_line":""},{"line_number":7718,"context_line":"        # Check allocations and usage on device RP assigned to instance"},{"line_number":7719,"context_line":"        device_rp_alloc \u003d allocs[device_rp_uuid]"}],"source_content_type":"text/x-python","patch_set":64,"id":"1fa4df85_96c72446","line":7716,"range":{"start_line":7716,"start_character":25,"end_line":7716,"end_character":58},"updated":"2020-03-02 15:45:59.000000000","message":"This is backwards -- assertEqual() takes expected, actual arguments.","commit_id":"82b1f15613a2f8b51c95b3143a155910ba876f26"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"6495f655ae43682ad54e4bd9bd75deb62bf1c8df","unresolved":false,"context_lines":[{"line_number":7713,"context_line":"        # Expected RPs are either (compute0, device0) or (compute1, device1)"},{"line_number":7714,"context_line":"        # We compare allocations on the host where the instance is scheduled."},{"line_number":7715,"context_line":"        expected_rp_uuids \u003d sorted([host_rp_uuid, device_rp_uuid])"},{"line_number":7716,"context_line":"        self.assertEqual(alloc_rp_uuids, expected_rp_uuids)"},{"line_number":7717,"context_line":""},{"line_number":7718,"context_line":"        # Check allocations and usage on device RP assigned to instance"},{"line_number":7719,"context_line":"        device_rp_alloc \u003d allocs[device_rp_uuid]"}],"source_content_type":"text/x-python","patch_set":64,"id":"1fa4df85_1ef4a685","line":7716,"range":{"start_line":7716,"start_character":25,"end_line":7716,"end_character":58},"in_reply_to":"1fa4df85_96c72446","updated":"2020-03-03 07:27:10.000000000","message":"Done","commit_id":"82b1f15613a2f8b51c95b3143a155910ba876f26"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"8fbd0e794e8c8e518d29e790a98e17395f8f54ba","unresolved":false,"context_lines":[{"line_number":7727,"context_line":"        for i in range(self.NUM_HOSTS):"},{"line_number":7728,"context_line":"            if self.compute_rp_uuids[i] !\u003d host_rp_uuid:"},{"line_number":7729,"context_line":"                allocs \u003d self._get_allocations_by_provider_uuid("},{"line_number":7730,"context_line":"                    self.compute_rp_uuids[i])"},{"line_number":7731,"context_line":""},{"line_number":7732,"context_line":"    def _check_no_allocations(self, server_uuid):"},{"line_number":7733,"context_line":"        allocs \u003d self._get_allocations_by_server_uuid(server_uuid)"}],"source_content_type":"text/x-python","patch_set":64,"id":"1fa4df85_96f5e485","line":7730,"updated":"2020-03-02 15:45:59.000000000","message":"This whole method seems like fishing with a rifle. Why can\u0027t we just generate an expected set of allocations and compare them to the instance\u0027s actual ones?","commit_id":"82b1f15613a2f8b51c95b3143a155910ba876f26"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"6495f655ae43682ad54e4bd9bd75deb62bf1c8df","unresolved":false,"context_lines":[{"line_number":7727,"context_line":"        for i in range(self.NUM_HOSTS):"},{"line_number":7728,"context_line":"            if self.compute_rp_uuids[i] !\u003d host_rp_uuid:"},{"line_number":7729,"context_line":"                allocs \u003d self._get_allocations_by_provider_uuid("},{"line_number":7730,"context_line":"                    self.compute_rp_uuids[i])"},{"line_number":7731,"context_line":""},{"line_number":7732,"context_line":"    def _check_no_allocations(self, server_uuid):"},{"line_number":7733,"context_line":"        allocs \u003d self._get_allocations_by_server_uuid(server_uuid)"}],"source_content_type":"text/x-python","patch_set":64,"id":"1fa4df85_79461424","line":7730,"in_reply_to":"1fa4df85_96f5e485","updated":"2020-03-03 07:27:10.000000000","message":"Comparing to the instance\u0027s actual allocations does not ensure that there are no allocations/usage in the other host/device. That said, let me see if I can simplify the checks.","commit_id":"82b1f15613a2f8b51c95b3143a155910ba876f26"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"8fbd0e794e8c8e518d29e790a98e17395f8f54ba","unresolved":false,"context_lines":[{"line_number":7758,"context_line":"                image_uuid\u003d\u0027155d900f-4e14-4e4c-a73d-069cbf4541e6\u0027,"},{"line_number":7759,"context_line":"                networks\u003d\u0027none\u0027, expected_state\u003d\u0027ACTIVE\u0027)"},{"line_number":7760,"context_line":""},{"line_number":7761,"context_line":"        self._check_allocations_usage_resched(server)"},{"line_number":7762,"context_line":""},{"line_number":7763,"context_line":"    def test_resched_fails(self):"},{"line_number":7764,"context_line":""}],"source_content_type":"text/x-python","patch_set":64,"id":"1fa4df85_b60ee08a","line":7761,"updated":"2020-03-02 15:45:59.000000000","message":"Where is the assertion that the reschedule actually happened? At least do this:\n\n self.assertEqual(2, fake_spawn.count)","commit_id":"82b1f15613a2f8b51c95b3143a155910ba876f26"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"6495f655ae43682ad54e4bd9bd75deb62bf1c8df","unresolved":false,"context_lines":[{"line_number":7758,"context_line":"                image_uuid\u003d\u0027155d900f-4e14-4e4c-a73d-069cbf4541e6\u0027,"},{"line_number":7759,"context_line":"                networks\u003d\u0027none\u0027, expected_state\u003d\u0027ACTIVE\u0027)"},{"line_number":7760,"context_line":""},{"line_number":7761,"context_line":"        self._check_allocations_usage_resched(server)"},{"line_number":7762,"context_line":""},{"line_number":7763,"context_line":"    def test_resched_fails(self):"},{"line_number":7764,"context_line":""}],"source_content_type":"text/x-python","patch_set":64,"id":"1fa4df85_d4634f19","line":7761,"in_reply_to":"1fa4df85_b60ee08a","updated":"2020-03-03 07:27:10.000000000","message":"Done","commit_id":"82b1f15613a2f8b51c95b3143a155910ba876f26"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6eaebb09d169b5c83b60e330286959b0e740144f","unresolved":false,"context_lines":[{"line_number":7699,"context_line":""},{"line_number":7700,"context_line":"    def _check_allocations_usage_resched(self, server):"},{"line_number":7701,"context_line":"        # Check allocations on host where instance is running"},{"line_number":7702,"context_line":"        vm_uuid \u003d server[\u0027id\u0027]"},{"line_number":7703,"context_line":""},{"line_number":7704,"context_line":"        instance_host_rp_uuid \u003d self._get_provider_uuid_by_host("},{"line_number":7705,"context_line":"            server[\u0027OS-EXT-SRV-ATTR:host\u0027])"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_338c1935","line":7702,"range":{"start_line":7702,"start_character":8,"end_line":7702,"end_character":15},"updated":"2020-03-04 14:25:17.000000000","message":"we tend to call these thing as a server instead of vm","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"876b576e3cfe4780860469091e44c36fd145fcc1","unresolved":false,"context_lines":[{"line_number":7699,"context_line":""},{"line_number":7700,"context_line":"    def _check_allocations_usage_resched(self, server):"},{"line_number":7701,"context_line":"        # Check allocations on host where instance is running"},{"line_number":7702,"context_line":"        vm_uuid \u003d server[\u0027id\u0027]"},{"line_number":7703,"context_line":""},{"line_number":7704,"context_line":"        instance_host_rp_uuid \u003d self._get_provider_uuid_by_host("},{"line_number":7705,"context_line":"            server[\u0027OS-EXT-SRV-ATTR:host\u0027])"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_97537817","line":7702,"range":{"start_line":7702,"start_character":8,"end_line":7702,"end_character":15},"in_reply_to":"1fa4df85_338c1935","updated":"2020-03-04 14:42:36.000000000","message":"My preference is instance over server :)\n\n...but VM is never correct.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"65d58351bad22fa57836ac9400ede66b75b19654","unresolved":false,"context_lines":[{"line_number":7699,"context_line":""},{"line_number":7700,"context_line":"    def _check_allocations_usage_resched(self, server):"},{"line_number":7701,"context_line":"        # Check allocations on host where instance is running"},{"line_number":7702,"context_line":"        vm_uuid \u003d server[\u0027id\u0027]"},{"line_number":7703,"context_line":""},{"line_number":7704,"context_line":"        instance_host_rp_uuid \u003d self._get_provider_uuid_by_host("},{"line_number":7705,"context_line":"            server[\u0027OS-EXT-SRV-ATTR:host\u0027])"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_f63cf7e1","line":7702,"range":{"start_line":7702,"start_character":8,"end_line":7702,"end_character":15},"in_reply_to":"1fa4df85_97537817","updated":"2020-03-08 23:24:35.000000000","message":"I know. The term \u0027server\u0027 is quite overloaded. In this context, there are no bare metal or containers involved -- we only deal with VMs. Anyway, I\u0027ll stick with \u0027server\u0027 because that term is already used all over the test infra.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6eaebb09d169b5c83b60e330286959b0e740144f","unresolved":false,"context_lines":[{"line_number":7701,"context_line":"        # Check allocations on host where instance is running"},{"line_number":7702,"context_line":"        vm_uuid \u003d server[\u0027id\u0027]"},{"line_number":7703,"context_line":""},{"line_number":7704,"context_line":"        instance_host_rp_uuid \u003d self._get_provider_uuid_by_host("},{"line_number":7705,"context_line":"            server[\u0027OS-EXT-SRV-ATTR:host\u0027])"},{"line_number":7706,"context_line":"        expected_host_alloc \u003d {"},{"line_number":7707,"context_line":"            \u0027resources\u0027: {\u0027VCPU\u0027: 2, \u0027MEMORY_MB\u0027: 2048, \u0027DISK_GB\u0027: 20},"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_9372ad48","line":7704,"range":{"start_line":7704,"start_character":8,"end_line":7704,"end_character":29},"updated":"2020-03-04 14:25:17.000000000","message":"please be consistent with naming. I suggest to use server all the way when you talk about vm or nova instance.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"65d58351bad22fa57836ac9400ede66b75b19654","unresolved":false,"context_lines":[{"line_number":7701,"context_line":"        # Check allocations on host where instance is running"},{"line_number":7702,"context_line":"        vm_uuid \u003d server[\u0027id\u0027]"},{"line_number":7703,"context_line":""},{"line_number":7704,"context_line":"        instance_host_rp_uuid \u003d self._get_provider_uuid_by_host("},{"line_number":7705,"context_line":"            server[\u0027OS-EXT-SRV-ATTR:host\u0027])"},{"line_number":7706,"context_line":"        expected_host_alloc \u003d {"},{"line_number":7707,"context_line":"            \u0027resources\u0027: {\u0027VCPU\u0027: 2, \u0027MEMORY_MB\u0027: 2048, \u0027DISK_GB\u0027: 20},"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_9627c3ca","line":7704,"range":{"start_line":7704,"start_character":8,"end_line":7704,"end_character":29},"in_reply_to":"1fa4df85_9372ad48","updated":"2020-03-08 23:24:35.000000000","message":"Done","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6eaebb09d169b5c83b60e330286959b0e740144f","unresolved":false,"context_lines":[{"line_number":7713,"context_line":"            device_uuid \u003d self.device_rp_map[compute_uuid]"},{"line_number":7714,"context_line":"            host_alloc \u003d self._get_allocations_by_provider_uuid(compute_uuid)"},{"line_number":7715,"context_line":"            device_alloc \u003d self._get_allocations_by_provider_uuid(device_uuid)"},{"line_number":7716,"context_line":"            if compute_uuid \u003d\u003d instance_host_rp_uuid:"},{"line_number":7717,"context_line":"                self.assertEqual(expected_host_alloc, host_alloc[vm_uuid])"},{"line_number":7718,"context_line":"                self.assertEqual(expected_device_alloc, device_alloc[vm_uuid])"},{"line_number":7719,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_d3cfc553","line":7716,"updated":"2020-03-04 14:25:17.000000000","message":"I think we should assert that the ARQs are also bound to the proper host.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"65d58351bad22fa57836ac9400ede66b75b19654","unresolved":false,"context_lines":[{"line_number":7713,"context_line":"            device_uuid \u003d self.device_rp_map[compute_uuid]"},{"line_number":7714,"context_line":"            host_alloc \u003d self._get_allocations_by_provider_uuid(compute_uuid)"},{"line_number":7715,"context_line":"            device_alloc \u003d self._get_allocations_by_provider_uuid(device_uuid)"},{"line_number":7716,"context_line":"            if compute_uuid \u003d\u003d instance_host_rp_uuid:"},{"line_number":7717,"context_line":"                self.assertEqual(expected_host_alloc, host_alloc[vm_uuid])"},{"line_number":7718,"context_line":"                self.assertEqual(expected_device_alloc, device_alloc[vm_uuid])"},{"line_number":7719,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_f615d749","line":7716,"in_reply_to":"1fa4df85_779cbcbf","updated":"2020-03-08 23:24:35.000000000","message":"Done. We can go beyond mocking, by checking that fake_get_arqs_for_instance returns ARQs with the right host name, device RP UUID and instance UUID. These 3 fields are not hardcoded but obtained from the test case.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"876b576e3cfe4780860469091e44c36fd145fcc1","unresolved":false,"context_lines":[{"line_number":7713,"context_line":"            device_uuid \u003d self.device_rp_map[compute_uuid]"},{"line_number":7714,"context_line":"            host_alloc \u003d self._get_allocations_by_provider_uuid(compute_uuid)"},{"line_number":7715,"context_line":"            device_alloc \u003d self._get_allocations_by_provider_uuid(device_uuid)"},{"line_number":7716,"context_line":"            if compute_uuid \u003d\u003d instance_host_rp_uuid:"},{"line_number":7717,"context_line":"                self.assertEqual(expected_host_alloc, host_alloc[vm_uuid])"},{"line_number":7718,"context_line":"                self.assertEqual(expected_device_alloc, device_alloc[vm_uuid])"},{"line_number":7719,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_779cbcbf","line":7716,"in_reply_to":"1fa4df85_d3cfc553","updated":"2020-03-04 14:42:36.000000000","message":"Just to clarify here, I think gibi means \"assert that we called the bind method with the expected host. Obviously in this faked environment nothing was bound anywhere, but the call we made is what we need to validate.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"cd157bf1019f7e268897eeb4d6b98ce5e47049fe","unresolved":false,"context_lines":[{"line_number":7713,"context_line":"            device_uuid \u003d self.device_rp_map[compute_uuid]"},{"line_number":7714,"context_line":"            host_alloc \u003d self._get_allocations_by_provider_uuid(compute_uuid)"},{"line_number":7715,"context_line":"            device_alloc \u003d self._get_allocations_by_provider_uuid(device_uuid)"},{"line_number":7716,"context_line":"            if compute_uuid \u003d\u003d instance_host_rp_uuid:"},{"line_number":7717,"context_line":"                self.assertEqual(expected_host_alloc, host_alloc[vm_uuid])"},{"line_number":7718,"context_line":"                self.assertEqual(expected_device_alloc, device_alloc[vm_uuid])"},{"line_number":7719,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_a0f5ba58","line":7716,"in_reply_to":"1fa4df85_f615d749","updated":"2020-03-10 17:17:27.000000000","message":"\u003e Done. We can go beyond mocking, by checking that fake_get_arqs_for_instance\n \u003e returns ARQs with the right host name, device RP UUID and instance\n \u003e UUID. These 3 fields are not hardcoded but obtained from the test\n \u003e case.\n\nYes, I\u0027d like to have these asserted.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d23e86774ffc5f770b24c791aed5d534e77d6226","unresolved":false,"context_lines":[{"line_number":7718,"context_line":"                self.assertEqual(expected_device_alloc, device_alloc[vm_uuid])"},{"line_number":7719,"context_line":"            else:"},{"line_number":7720,"context_line":"                self.assertEqual({}, host_alloc)"},{"line_number":7721,"context_line":"                self.assertEqual({}, device_alloc)"},{"line_number":7722,"context_line":""},{"line_number":7723,"context_line":"    def _check_no_allocations(self, server_uuid):"},{"line_number":7724,"context_line":"        allocs \u003d self._get_allocations_by_server_uuid(server_uuid)"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_12532d41","line":7721,"updated":"2020-03-03 14:52:56.000000000","message":"Yes, this is much easier to follow, thanks.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6eaebb09d169b5c83b60e330286959b0e740144f","unresolved":false,"context_lines":[{"line_number":7727,"context_line":"        for i in range(self.NUM_HOSTS):"},{"line_number":7728,"context_line":"            usage \u003d self._get_provider_usages("},{"line_number":7729,"context_line":"                self.device_rp_uuids[i]).get(\u0027FPGA\u0027)"},{"line_number":7730,"context_line":"            self.assertEqual(usage, 0)"},{"line_number":7731,"context_line":""},{"line_number":7732,"context_line":"    def test_resched(self):"},{"line_number":7733,"context_line":"        orig_spawn \u003d fake.FakeDriver.spawn"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_f3e441e2","line":7730,"updated":"2020-03-04 14:25:17.000000000","message":"I think we should check that the ARQs are not bound to any host.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"65d58351bad22fa57836ac9400ede66b75b19654","unresolved":false,"context_lines":[{"line_number":7727,"context_line":"        for i in range(self.NUM_HOSTS):"},{"line_number":7728,"context_line":"            usage \u003d self._get_provider_usages("},{"line_number":7729,"context_line":"                self.device_rp_uuids[i]).get(\u0027FPGA\u0027)"},{"line_number":7730,"context_line":"            self.assertEqual(usage, 0)"},{"line_number":7731,"context_line":""},{"line_number":7732,"context_line":"    def test_resched(self):"},{"line_number":7733,"context_line":"        orig_spawn \u003d fake.FakeDriver.spawn"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_3905a011","line":7730,"in_reply_to":"1fa4df85_f3e441e2","updated":"2020-03-08 23:24:35.000000000","message":"That\u0027s a bit difficult to do here because (a) the hardcoded fixture fake_get_arqs_for_instance always returns the same data and (b) the deletion/unbinding of ARQs is handled in a subsequent patch [1].\n\nHowever, that patch does assert that delete_arqs API is called [2]. Similar to what Dan said in L7716 above, that is the best we can do here.\n\n[1] https://review.opendev.org/#/c/673735/ \n[2] https://review.opendev.org/#/c/673735/41/nova/tests/functional/test_servers.py@7706","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"}],"nova/tests/unit/accelerator/test_cyborg.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"faa1d71ff475c4520ae46390e025c8e8c2106b9c","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        return bindings, bound_arqs"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    @mock.patch(\u0027keystoneauth1.adapter.Adapter.post\u0027)"},{"line_number":138,"context_line":"    def test_create_arqs(self, mock_cyborg_post):"},{"line_number":139,"context_line":"        # If Cyborg returns invalid response, raise exception."},{"line_number":140,"context_line":"        mock_cyborg_post.return_value \u003d None"},{"line_number":141,"context_line":"        self.assertRaises(exception.AcceleratorRequestOpFailed,"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_6d015804","line":138,"range":{"start_line":138,"start_character":8,"end_line":138,"end_character":24},"updated":"2020-01-02 16:53:44.000000000","message":"This name makes it sound like you\u0027re testing that method\u0027s happy path, but you\u0027re really testing that it fails in a specific way, so I think the name should change.\n\nAlso, the happy path for that *should* be tested in isolation since it\u0027s making a specific requests call and doing something with the result.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"de51d74be4f298607f844c9eaf62341543b88a8a","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        return bindings, bound_arqs"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    @mock.patch(\u0027keystoneauth1.adapter.Adapter.post\u0027)"},{"line_number":138,"context_line":"    def test_create_arqs(self, mock_cyborg_post):"},{"line_number":139,"context_line":"        # If Cyborg returns invalid response, raise exception."},{"line_number":140,"context_line":"        mock_cyborg_post.return_value \u003d None"},{"line_number":141,"context_line":"        self.assertRaises(exception.AcceleratorRequestOpFailed,"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_01132f67","line":138,"range":{"start_line":138,"start_character":8,"end_line":138,"end_character":24},"in_reply_to":"3fa7e38b_0127af65","updated":"2020-01-15 15:16:13.000000000","message":"Will change the name.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"59972f9bfeb33055cf27ccb66e1ec3ba050c9a65","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        return bindings, bound_arqs"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    @mock.patch(\u0027keystoneauth1.adapter.Adapter.post\u0027)"},{"line_number":138,"context_line":"    def test_create_arqs(self, mock_cyborg_post):"},{"line_number":139,"context_line":"        # If Cyborg returns invalid response, raise exception."},{"line_number":140,"context_line":"        mock_cyborg_post.return_value \u003d None"},{"line_number":141,"context_line":"        self.assertRaises(exception.AcceleratorRequestOpFailed,"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_0127af65","line":138,"range":{"start_line":138,"start_character":8,"end_line":138,"end_character":24},"in_reply_to":"3fa7e38b_39c0ec4a","updated":"2020-01-15 14:52:27.000000000","message":"Right, which is why the name is the problem.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"e454cb6639c09987c8947c61f09efcd8de39c641","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        return bindings, bound_arqs"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    @mock.patch(\u0027keystoneauth1.adapter.Adapter.post\u0027)"},{"line_number":138,"context_line":"    def test_create_arqs(self, mock_cyborg_post):"},{"line_number":139,"context_line":"        # If Cyborg returns invalid response, raise exception."},{"line_number":140,"context_line":"        mock_cyborg_post.return_value \u003d None"},{"line_number":141,"context_line":"        self.assertRaises(exception.AcceleratorRequestOpFailed,"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_39c0ec4a","line":138,"range":{"start_line":138,"start_character":8,"end_line":138,"end_character":24},"in_reply_to":"3fa7e38b_6d015804","updated":"2020-01-15 07:04:59.000000000","message":"Will change the name.\n\nBut the \u0027happy path\u0027 of this function is just calling POST, and then json().get(\u0027arqs\u0027) on the result. If I were to mock the return value from POST, by creating a dict and converting it to json, that would essentially be just testing the mocking logic itself.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"faa1d71ff475c4520ae46390e025c8e8c2106b9c","unresolved":false,"context_lines":[{"line_number":153,"context_line":"            dp_name, rg_rp_map)"},{"line_number":154,"context_line":"        mapped_rp_uuids \u003d list(rg_rp_map.values())[0]"},{"line_number":155,"context_line":"        self.assertTrue(ret_arqs[0][\u0027device_rp_uuid\u0027] \u003d\u003d"},{"line_number":156,"context_line":"                        mapped_rp_uuids[0])"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        # If Cyborg response does not contain ARQs, raise"},{"line_number":159,"context_line":"        mock_create_arqs.return_value \u003d None"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_8d2e148b","line":156,"updated":"2020-01-02 16:53:44.000000000","message":"The actual code has a loop for handling multiple things. We know that\u0027s running on your single-arq case to handle the [0] item, but I think you should have multiple things for it to loop over to ensure that behavior remains externally.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"e454cb6639c09987c8947c61f09efcd8de39c641","unresolved":false,"context_lines":[{"line_number":153,"context_line":"            dp_name, rg_rp_map)"},{"line_number":154,"context_line":"        mapped_rp_uuids \u003d list(rg_rp_map.values())[0]"},{"line_number":155,"context_line":"        self.assertTrue(ret_arqs[0][\u0027device_rp_uuid\u0027] \u003d\u003d"},{"line_number":156,"context_line":"                        mapped_rp_uuids[0])"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        # If Cyborg response does not contain ARQs, raise"},{"line_number":159,"context_line":"        mock_create_arqs.return_value \u003d None"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_b48141c5","line":156,"in_reply_to":"3fa7e38b_8d2e148b","updated":"2020-01-15 07:04:59.000000000","message":"Done","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"faa1d71ff475c4520ae46390e025c8e8c2106b9c","unresolved":false,"context_lines":[{"line_number":155,"context_line":"        self.assertTrue(ret_arqs[0][\u0027device_rp_uuid\u0027] \u003d\u003d"},{"line_number":156,"context_line":"                        mapped_rp_uuids[0])"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        # If Cyborg response does not contain ARQs, raise"},{"line_number":159,"context_line":"        mock_create_arqs.return_value \u003d None"},{"line_number":160,"context_line":"        self.assertRaises("},{"line_number":161,"context_line":"            exception.AcceleratorRequestOpFailed,"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_cd388cd5","line":158,"updated":"2020-01-02 16:53:44.000000000","message":"You stuff a lot of cases into single test methods, which isn\u0027t really our pattern. Can you split these out (here and elsewhere) so that a failure in an error handling block is distinct from \"the whole thing is broken\" please?","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"e454cb6639c09987c8947c61f09efcd8de39c641","unresolved":false,"context_lines":[{"line_number":155,"context_line":"        self.assertTrue(ret_arqs[0][\u0027device_rp_uuid\u0027] \u003d\u003d"},{"line_number":156,"context_line":"                        mapped_rp_uuids[0])"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        # If Cyborg response does not contain ARQs, raise"},{"line_number":159,"context_line":"        mock_create_arqs.return_value \u003d None"},{"line_number":160,"context_line":"        self.assertRaises("},{"line_number":161,"context_line":"            exception.AcceleratorRequestOpFailed,"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_5466cd58","line":158,"in_reply_to":"3fa7e38b_cd388cd5","updated":"2020-01-15 07:04:59.000000000","message":"Done","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"faa1d71ff475c4520ae46390e025c8e8c2106b9c","unresolved":false,"context_lines":[{"line_number":180,"context_line":"        patch_list \u003d {arq_uuid: patch}"},{"line_number":181,"context_line":"        mock_cyborg_patch.return_value \u003d 1  # Dummy value"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        self.client.bind_arqs(bindings)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        self.assertTrue(mock_cyborg_patch.call_count \u003d\u003d 1)"},{"line_number":186,"context_line":"        args, kwargs \u003d mock_cyborg_patch.call_args"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_edd6a853","line":183,"updated":"2020-01-02 16:53:44.000000000","message":"In this case, bindings is just one, right? Your code handles multiples, yet this doesn\u0027t really prove that it does that properly. Can you please add another binding to ensure it\u0027s looping?","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"e454cb6639c09987c8947c61f09efcd8de39c641","unresolved":false,"context_lines":[{"line_number":180,"context_line":"        patch_list \u003d {arq_uuid: patch}"},{"line_number":181,"context_line":"        mock_cyborg_patch.return_value \u003d 1  # Dummy value"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        self.client.bind_arqs(bindings)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        self.assertTrue(mock_cyborg_patch.call_count \u003d\u003d 1)"},{"line_number":186,"context_line":"        args, kwargs \u003d mock_cyborg_patch.call_args"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_5a627717","line":183,"in_reply_to":"3fa7e38b_edd6a853","updated":"2020-01-15 07:04:59.000000000","message":"Done","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"faa1d71ff475c4520ae46390e025c8e8c2106b9c","unresolved":false,"context_lines":[{"line_number":188,"context_line":"        self.assertTrue(called_url \u003d\u003d self.client.ARQ_URL)"},{"line_number":189,"context_line":"        self.assertEqual(sorted(called_params), sorted(patch_list))"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        # If Cyborg returns invalid response, raise exception."},{"line_number":192,"context_line":"        mock_cyborg_patch.return_value \u003d None"},{"line_number":193,"context_line":"        self.assertRaises(exception.AcceleratorRequestOpFailed,"},{"line_number":194,"context_line":"            self.client.bind_arqs, bindings\u003d{})"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_8d8a9462","line":191,"updated":"2020-01-02 16:53:44.000000000","message":"Same deal, this is really a separate test case and should be represented here as such.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"e454cb6639c09987c8947c61f09efcd8de39c641","unresolved":false,"context_lines":[{"line_number":188,"context_line":"        self.assertTrue(called_url \u003d\u003d self.client.ARQ_URL)"},{"line_number":189,"context_line":"        self.assertEqual(sorted(called_params), sorted(patch_list))"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        # If Cyborg returns invalid response, raise exception."},{"line_number":192,"context_line":"        mock_cyborg_patch.return_value \u003d None"},{"line_number":193,"context_line":"        self.assertRaises(exception.AcceleratorRequestOpFailed,"},{"line_number":194,"context_line":"            self.client.bind_arqs, bindings\u003d{})"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_fa66c328","line":191,"in_reply_to":"3fa7e38b_8d8a9462","updated":"2020-01-15 07:04:59.000000000","message":"Done","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"faa1d71ff475c4520ae46390e025c8e8c2106b9c","unresolved":false,"context_lines":[{"line_number":248,"context_line":"        instance_uuid \u003d bound_arqs[0][\u0027instance_uuid\u0027]"},{"line_number":249,"context_line":"        # Make all ARQs look like they are not bound"},{"line_number":250,"context_line":"        for arq in arqs:"},{"line_number":251,"context_line":"            arq[\u0027state\u0027] \u003d \u0027Initial\u0027"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"        query \u003d {\"instance\": instance_uuid}"},{"line_number":254,"context_line":"        content \u003d jsonutils.dumps({\u0027arqs\u0027: arqs})"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_2dca809f","line":251,"updated":"2020-01-02 16:53:44.000000000","message":"Wouldn\u0027t it be better to just set one to Initial and make sure you get back all the ones except that one? The all-or-nothing test makes it more susceptible to a false positive.\n\nAlso, it looks like this is missing tests for the other terminal states of BindFailed and Deleting.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"e454cb6639c09987c8947c61f09efcd8de39c641","unresolved":false,"context_lines":[{"line_number":248,"context_line":"        instance_uuid \u003d bound_arqs[0][\u0027instance_uuid\u0027]"},{"line_number":249,"context_line":"        # Make all ARQs look like they are not bound"},{"line_number":250,"context_line":"        for arq in arqs:"},{"line_number":251,"context_line":"            arq[\u0027state\u0027] \u003d \u0027Initial\u0027"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"        query \u003d {\"instance\": instance_uuid}"},{"line_number":254,"context_line":"        content \u003d jsonutils.dumps({\u0027arqs\u0027: arqs})"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_bdd60554","line":251,"in_reply_to":"3fa7e38b_2dca809f","updated":"2020-01-15 07:04:59.000000000","message":"I have added more ARQs in the unit test data and that allows us to test a mixture of bound and unbound ARQs in the response.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"90445130fa5695291fd6407fdb2ff8e167b97167","unresolved":false,"context_lines":[{"line_number":201,"context_line":""},{"line_number":202,"context_line":"        self.client.bind_arqs(bindings)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        mock_cyborg_patch.assert_called_once()"},{"line_number":205,"context_line":"        # self.assertTrue(mock_cyborg_patch.call_count \u003d\u003d 1)"},{"line_number":206,"context_line":"        args, kwargs \u003d mock_cyborg_patch.call_args"},{"line_number":207,"context_line":"        called_url, called_params \u003d args[0], kwargs[\u0027json\u0027]"}],"source_content_type":"text/x-python","patch_set":54,"id":"3fa7e38b_f41eab73","line":204,"updated":"2020-01-17 15:05:17.000000000","message":"assert_called_once_with() ?","commit_id":"ecf94f0e8431d8e1b6c04cd66fa13ad53212f0c3"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"a881a60fe2d8f71748785270b163f8125847c1a1","unresolved":false,"context_lines":[{"line_number":201,"context_line":""},{"line_number":202,"context_line":"        self.client.bind_arqs(bindings)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        mock_cyborg_patch.assert_called_once()"},{"line_number":205,"context_line":"        # self.assertTrue(mock_cyborg_patch.call_count \u003d\u003d 1)"},{"line_number":206,"context_line":"        args, kwargs \u003d mock_cyborg_patch.call_args"},{"line_number":207,"context_line":"        called_url, called_params \u003d args[0], kwargs[\u0027json\u0027]"}],"source_content_type":"text/x-python","patch_set":54,"id":"3fa7e38b_344e6090","line":204,"in_reply_to":"3fa7e38b_f41eab73","updated":"2020-01-26 01:11:27.000000000","message":"Done","commit_id":"ecf94f0e8431d8e1b6c04cd66fa13ad53212f0c3"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"90445130fa5695291fd6407fdb2ff8e167b97167","unresolved":false,"context_lines":[{"line_number":202,"context_line":"        self.client.bind_arqs(bindings)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        mock_cyborg_patch.assert_called_once()"},{"line_number":205,"context_line":"        # self.assertTrue(mock_cyborg_patch.call_count \u003d\u003d 1)"},{"line_number":206,"context_line":"        args, kwargs \u003d mock_cyborg_patch.call_args"},{"line_number":207,"context_line":"        called_url, called_params \u003d args[0], kwargs[\u0027json\u0027]"},{"line_number":208,"context_line":"        self.assertTrue(called_url \u003d\u003d self.client.ARQ_URL)"}],"source_content_type":"text/x-python","patch_set":54,"id":"3fa7e38b_d44e0f8f","line":205,"updated":"2020-01-17 15:05:17.000000000","message":"Assume you meant to remove this.","commit_id":"ecf94f0e8431d8e1b6c04cd66fa13ad53212f0c3"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"a881a60fe2d8f71748785270b163f8125847c1a1","unresolved":false,"context_lines":[{"line_number":202,"context_line":"        self.client.bind_arqs(bindings)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        mock_cyborg_patch.assert_called_once()"},{"line_number":205,"context_line":"        # self.assertTrue(mock_cyborg_patch.call_count \u003d\u003d 1)"},{"line_number":206,"context_line":"        args, kwargs \u003d mock_cyborg_patch.call_args"},{"line_number":207,"context_line":"        called_url, called_params \u003d args[0], kwargs[\u0027json\u0027]"},{"line_number":208,"context_line":"        self.assertTrue(called_url \u003d\u003d self.client.ARQ_URL)"}],"source_content_type":"text/x-python","patch_set":54,"id":"3fa7e38b_f431a80b","line":205,"in_reply_to":"3fa7e38b_d44e0f8f","updated":"2020-01-26 01:11:27.000000000","message":"Done","commit_id":"ecf94f0e8431d8e1b6c04cd66fa13ad53212f0c3"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"23a64313d3acef9ac99b0b40a93545acb0c2b25b","unresolved":false,"context_lines":[{"line_number":274,"context_line":"        mock_cyborg_get.assert_called_once_with("},{"line_number":275,"context_line":"            self.client.ARQ_URL, params\u003dquery)"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"        bound_arqs.sort(key\u003dlambda x: x[\u0027uuid\u0027])"},{"line_number":278,"context_line":"        ret_arqs.sort(key\u003dlambda x: x[\u0027uuid\u0027])"},{"line_number":279,"context_line":"        for ret_arq, bound_arq in zip(ret_arqs, bound_arqs):"},{"line_number":280,"context_line":"            self.assertDictEqual(ret_arq, bound_arq)"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"    @mock.patch(\u0027keystoneauth1.adapter.Adapter.get\u0027)"},{"line_number":283,"context_line":"    def test_get_arqs_for_instance_exception(self, mock_cyborg_get):"}],"source_content_type":"text/x-python","patch_set":69,"id":"df33271e_a736b3b3","line":280,"range":{"start_line":277,"start_character":0,"end_line":280,"end_character":52},"updated":"2020-03-23 17:30:23.000000000","message":"this should be fine but i wonder if we would have enough coverage if we jsut asserted that bound_args and ret_args are equal after we sorted them.\n\nbut ya this makes sense it just feels verbose.","commit_id":"cc630b4eb62c4a45ff08a1862a8339a0f129e0a3"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"23a64313d3acef9ac99b0b40a93545acb0c2b25b","unresolved":false,"context_lines":[{"line_number":293,"context_line":""},{"line_number":294,"context_line":"    @mock.patch(\u0027keystoneauth1.adapter.Adapter.get\u0027)"},{"line_number":295,"context_line":"    def test_get_arqs_for_instance_exception_no_resp(self, mock_cyborg_get):"},{"line_number":296,"context_line":"        # If Cyborg returns an error code, raise exception"},{"line_number":297,"context_line":"        _, bound_arqs \u003d self._get_bound_arqs()"},{"line_number":298,"context_line":"        instance_uuid \u003d bound_arqs[0][\u0027instance_uuid\u0027]"},{"line_number":299,"context_line":""}],"source_content_type":"text/x-python","patch_set":69,"id":"df33271e_a75fd3e3","line":296,"range":{"start_line":296,"start_character":30,"end_line":296,"end_character":41},"updated":"2020-03-23 17:30:23.000000000","message":"nit: empty responce.","commit_id":"cc630b4eb62c4a45ff08a1862a8339a0f129e0a3"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"23a64313d3acef9ac99b0b40a93545acb0c2b25b","unresolved":false,"context_lines":[{"line_number":298,"context_line":"        instance_uuid \u003d bound_arqs[0][\u0027instance_uuid\u0027]"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":"        content \u003d jsonutils.dumps({\u0027noarqs\u0027: \u0027oops\u0027})"},{"line_number":301,"context_line":"        resp \u003d fake_requests.FakeResponse(200, content)"},{"line_number":302,"context_line":"        mock_cyborg_get.return_value \u003d resp"},{"line_number":303,"context_line":"        self.assertRaisesRegex("},{"line_number":304,"context_line":"            exception.AcceleratorRequestOpFailed,"}],"source_content_type":"text/x-python","patch_set":69,"id":"df33271e_87644fbb","line":301,"range":{"start_line":301,"start_character":41,"end_line":301,"end_character":46},"updated":"2020-03-23 17:30:23.000000000","message":"since 200 is not an error","commit_id":"cc630b4eb62c4a45ff08a1862a8339a0f129e0a3"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"23a64313d3acef9ac99b0b40a93545acb0c2b25b","unresolved":false,"context_lines":[{"line_number":322,"context_line":"        mock_cyborg_get.assert_called_once_with("},{"line_number":323,"context_line":"            self.client.ARQ_URL, params\u003dquery)"},{"line_number":324,"context_line":""},{"line_number":325,"context_line":"        bound_arqs.sort(key\u003dlambda x: x[\u0027uuid\u0027])"},{"line_number":326,"context_line":"        ret_arqs.sort(key\u003dlambda x: x[\u0027uuid\u0027])"},{"line_number":327,"context_line":"        for ret_arq, bound_arq in zip(ret_arqs, bound_arqs):"},{"line_number":328,"context_line":"            self.assertDictEqual(ret_arq, bound_arq)"},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"    @mock.patch(\u0027keystoneauth1.adapter.Adapter.get\u0027)"},{"line_number":331,"context_line":"    def test_get_arqs_for_instance_some_resolved(self, mock_cyborg_get):"}],"source_content_type":"text/x-python","patch_set":69,"id":"df33271e_8709efde","line":328,"range":{"start_line":325,"start_character":8,"end_line":328,"end_character":52},"updated":"2020-03-23 17:30:23.000000000","message":"nit: this is the same as above on line 277 so you could factor this out into a function but im also ok with this since its only done twice.\n\nif this was repeated more i think a prive function would be nice.","commit_id":"cc630b4eb62c4a45ff08a1862a8339a0f129e0a3"}],"nova/tests/unit/compute/test_compute_mgr.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b223f4d0583b0f4de2a6e7243b6c27636b35ae38","unresolved":false,"context_lines":[{"line_number":6056,"context_line":"        self.assertEqual(sorted(resources[\u0027accel_info\u0027]), sorted(arq_list))"},{"line_number":6057,"context_line":"        mock_get_arqs.reset_mock()"},{"line_number":6058,"context_line":""},{"line_number":6059,"context_line":"        # Exception path"},{"line_number":6060,"context_line":"        mock_get_arqs.side_effect \u003d Exception"},{"line_number":6061,"context_line":"        got_exception \u003d False"},{"line_number":6062,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_28d37539","line":6059,"updated":"2019-12-04 15:08:51.000000000","message":"Can you split all of these into separate happy/error test functions? They can call a helper (i.e. self._test_thing(raise\u003dFalse)) but it\u0027s a lot safer than hand-resetting mocks in the middle of a test. If you miss one, you might be getting a different result than you think.","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"14c3bb47bd071a2e4542f5530e7a25f25f235769","unresolved":false,"context_lines":[{"line_number":6056,"context_line":"        self.assertEqual(sorted(resources[\u0027accel_info\u0027]), sorted(arq_list))"},{"line_number":6057,"context_line":"        mock_get_arqs.reset_mock()"},{"line_number":6058,"context_line":""},{"line_number":6059,"context_line":"        # Exception path"},{"line_number":6060,"context_line":"        mock_get_arqs.side_effect \u003d Exception"},{"line_number":6061,"context_line":"        got_exception \u003d False"},{"line_number":6062,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa7e38b_c9672751","line":6059,"in_reply_to":"3fa7e38b_28d37539","updated":"2019-12-09 03:50:21.000000000","message":"Done","commit_id":"f561b564321c59ffb151ff61b311686505b18059"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"faa1d71ff475c4520ae46390e025c8e8c2106b9c","unresolved":false,"context_lines":[{"line_number":6095,"context_line":"        arq_events \u003d [(\u0027accelerator-request-bound\u0027, arq[\u0027uuid\u0027])"},{"line_number":6096,"context_line":"                      for arq in arq_list]"},{"line_number":6097,"context_line":""},{"line_number":6098,"context_line":"        mock_get_arqs.side_effect \u003d [arq_list, arq_list]"},{"line_number":6099,"context_line":""},{"line_number":6100,"context_line":"        ret_arqs \u003d self.compute._get_bound_arq_resources("},{"line_number":6101,"context_line":"            self.context, dp_name, self.instance)"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_fbe741aa","line":6098,"updated":"2020-01-02 16:53:44.000000000","message":"This would be clearer as:\n\n mock_get_arqs.return_value \u003d arq_list\n\nright? If you\u0027re expecting it to always return the same thing...","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"a1d5154698a2e953c864d73932105a289c982d02","unresolved":false,"context_lines":[{"line_number":6095,"context_line":"        arq_events \u003d [(\u0027accelerator-request-bound\u0027, arq[\u0027uuid\u0027])"},{"line_number":6096,"context_line":"                      for arq in arq_list]"},{"line_number":6097,"context_line":""},{"line_number":6098,"context_line":"        mock_get_arqs.side_effect \u003d [arq_list, arq_list]"},{"line_number":6099,"context_line":""},{"line_number":6100,"context_line":"        ret_arqs \u003d self.compute._get_bound_arq_resources("},{"line_number":6101,"context_line":"            self.context, dp_name, self.instance)"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_379a29c4","line":6098,"in_reply_to":"3fa7e38b_04a49d06","updated":"2020-01-18 16:40:45.000000000","message":"Will change it to return_value.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"4c92fa535a492d13651d3fd5c2ca40ea152ef7a2","unresolved":false,"context_lines":[{"line_number":6095,"context_line":"        arq_events \u003d [(\u0027accelerator-request-bound\u0027, arq[\u0027uuid\u0027])"},{"line_number":6096,"context_line":"                      for arq in arq_list]"},{"line_number":6097,"context_line":""},{"line_number":6098,"context_line":"        mock_get_arqs.side_effect \u003d [arq_list, arq_list]"},{"line_number":6099,"context_line":""},{"line_number":6100,"context_line":"        ret_arqs \u003d self.compute._get_bound_arq_resources("},{"line_number":6101,"context_line":"            self.context, dp_name, self.instance)"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_94bc3eb6","line":6098,"in_reply_to":"3fa7e38b_3a469b80","updated":"2020-01-15 13:49:05.000000000","message":"On closer look, this doesn\u0027t work. If the mock_foo.return_value is a list, each element of the list is returned for successive calls to foo(). So, mock_get_arqs winds up getting a dict instead of a list with this change.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"59972f9bfeb33055cf27ccb66e1ec3ba050c9a65","unresolved":false,"context_lines":[{"line_number":6095,"context_line":"        arq_events \u003d [(\u0027accelerator-request-bound\u0027, arq[\u0027uuid\u0027])"},{"line_number":6096,"context_line":"                      for arq in arq_list]"},{"line_number":6097,"context_line":""},{"line_number":6098,"context_line":"        mock_get_arqs.side_effect \u003d [arq_list, arq_list]"},{"line_number":6099,"context_line":""},{"line_number":6100,"context_line":"        ret_arqs \u003d self.compute._get_bound_arq_resources("},{"line_number":6101,"context_line":"            self.context, dp_name, self.instance)"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_c1c6776a","line":6098,"in_reply_to":"3fa7e38b_94bc3eb6","updated":"2020-01-15 14:52:27.000000000","message":"You\u0027re describing the behavior of side_effect, not return_value. The latter should always return the thing you give it:\n\nhttps://docs.python.org/3/library/unittest.mock.html#unittest.mock.Mock.return_value\n\nAsserting that it\u0027s called twice by not providing for a third invocation just makes it harder to debug what\u0027s going on if the test starts to fail. If someone sees a \"this should be called twice but was called thrice\" it\u0027s pretty clear what is going on.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"de51d74be4f298607f844c9eaf62341543b88a8a","unresolved":false,"context_lines":[{"line_number":6095,"context_line":"        arq_events \u003d [(\u0027accelerator-request-bound\u0027, arq[\u0027uuid\u0027])"},{"line_number":6096,"context_line":"                      for arq in arq_list]"},{"line_number":6097,"context_line":""},{"line_number":6098,"context_line":"        mock_get_arqs.side_effect \u003d [arq_list, arq_list]"},{"line_number":6099,"context_line":""},{"line_number":6100,"context_line":"        ret_arqs \u003d self.compute._get_bound_arq_resources("},{"line_number":6101,"context_line":"            self.context, dp_name, self.instance)"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_04a49d06","line":6098,"in_reply_to":"3fa7e38b_c1c6776a","updated":"2020-01-15 15:16:13.000000000","message":"I stepped through the test code and real code, and noticed that the return value was a dict, not a list.\n\nThere is an explicit assertion later that this function is called twice, and I am updating that to mock_get_arqs.assert_has_calls(), as you commented below. I also clarified the comments about this call.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"e454cb6639c09987c8947c61f09efcd8de39c641","unresolved":false,"context_lines":[{"line_number":6095,"context_line":"        arq_events \u003d [(\u0027accelerator-request-bound\u0027, arq[\u0027uuid\u0027])"},{"line_number":6096,"context_line":"                      for arq in arq_list]"},{"line_number":6097,"context_line":""},{"line_number":6098,"context_line":"        mock_get_arqs.side_effect \u003d [arq_list, arq_list]"},{"line_number":6099,"context_line":""},{"line_number":6100,"context_line":"        ret_arqs \u003d self.compute._get_bound_arq_resources("},{"line_number":6101,"context_line":"            self.context, dp_name, self.instance)"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_3a469b80","line":6098,"in_reply_to":"3fa7e38b_fbe741aa","updated":"2020-01-15 07:04:59.000000000","message":"I was trying to make it explicit that this function gets called twice in this scenario. But I am fine either way. Changed.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"faa1d71ff475c4520ae46390e025c8e8c2106b9c","unresolved":false,"context_lines":[{"line_number":6104,"context_line":"            self.instance, arq_events, deadline\u003dmock.ANY)"},{"line_number":6105,"context_line":"        mock_exit_wait_early.assert_called_once_with(arq_events)"},{"line_number":6106,"context_line":""},{"line_number":6107,"context_line":"        self.assertEqual(mock_get_arqs.call_count, 2)"},{"line_number":6108,"context_line":"        # First call has instance.uuid but not only_resolved"},{"line_number":6109,"context_line":"        call_args0 \u003d mock_get_arqs.call_args_list[0]"},{"line_number":6110,"context_line":"        self.assertEqual(len(call_args0), 2)"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_3b4e3996","line":6107,"updated":"2020-01-02 16:53:44.000000000","message":"I would mirror the comment you have below here, something like:\n\n get_arqs is called once to get the full set, once to check for any that are bound, and then skipped since all are already bound for efficiency.\n\nAlso, maybe move the comment in the test below (L6135) to its assert call_count line for symmetry.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"4c92fa535a492d13651d3fd5c2ca40ea152ef7a2","unresolved":false,"context_lines":[{"line_number":6104,"context_line":"            self.instance, arq_events, deadline\u003dmock.ANY)"},{"line_number":6105,"context_line":"        mock_exit_wait_early.assert_called_once_with(arq_events)"},{"line_number":6106,"context_line":""},{"line_number":6107,"context_line":"        self.assertEqual(mock_get_arqs.call_count, 2)"},{"line_number":6108,"context_line":"        # First call has instance.uuid but not only_resolved"},{"line_number":6109,"context_line":"        call_args0 \u003d mock_get_arqs.call_args_list[0]"},{"line_number":6110,"context_line":"        self.assertEqual(len(call_args0), 2)"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_8faf4bdf","line":6107,"in_reply_to":"3fa7e38b_3b4e3996","updated":"2020-01-15 13:49:05.000000000","message":"Done","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"faa1d71ff475c4520ae46390e025c8e8c2106b9c","unresolved":false,"context_lines":[{"line_number":6105,"context_line":"        mock_exit_wait_early.assert_called_once_with(arq_events)"},{"line_number":6106,"context_line":""},{"line_number":6107,"context_line":"        self.assertEqual(mock_get_arqs.call_count, 2)"},{"line_number":6108,"context_line":"        # First call has instance.uuid but not only_resolved"},{"line_number":6109,"context_line":"        call_args0 \u003d mock_get_arqs.call_args_list[0]"},{"line_number":6110,"context_line":"        self.assertEqual(len(call_args0), 2)"},{"line_number":6111,"context_line":"        self.assertEqual(call_args0.args[0], self.instance.uuid)"},{"line_number":6112,"context_line":"        self.assertEqual(call_args0.kwargs, {})"},{"line_number":6113,"context_line":"        # Second call has both"},{"line_number":6114,"context_line":"        call_args1 \u003d mock_get_arqs.call_args_list[1]"},{"line_number":6115,"context_line":"        self.assertEqual(len(call_args1), 2)"},{"line_number":6116,"context_line":"        self.assertEqual(call_args1.args[0], self.instance.uuid)"},{"line_number":6117,"context_line":"        self.assertEqual(call_args1.kwargs, {\u0027only_resolved\u0027: True})"},{"line_number":6118,"context_line":""},{"line_number":6119,"context_line":"        self.assertEqual(sorted(ret_arqs), sorted(arq_list))"},{"line_number":6120,"context_line":""}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_fb9c210e","line":6117,"range":{"start_line":6108,"start_character":0,"end_line":6117,"end_character":68},"updated":"2020-01-02 16:53:44.000000000","message":"Can\u0027t you do this more cleanly with has_calls?\n\n mock_get_arqs.assert_has_calls([\n     mock.call(self.instance.uuid, only_resolved\u003dFalse),\n     mock.call(self.instance.uuid, only_resolved\u003dTrue)])","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"de51d74be4f298607f844c9eaf62341543b88a8a","unresolved":false,"context_lines":[{"line_number":6105,"context_line":"        mock_exit_wait_early.assert_called_once_with(arq_events)"},{"line_number":6106,"context_line":""},{"line_number":6107,"context_line":"        self.assertEqual(mock_get_arqs.call_count, 2)"},{"line_number":6108,"context_line":"        # First call has instance.uuid but not only_resolved"},{"line_number":6109,"context_line":"        call_args0 \u003d mock_get_arqs.call_args_list[0]"},{"line_number":6110,"context_line":"        self.assertEqual(len(call_args0), 2)"},{"line_number":6111,"context_line":"        self.assertEqual(call_args0.args[0], self.instance.uuid)"},{"line_number":6112,"context_line":"        self.assertEqual(call_args0.kwargs, {})"},{"line_number":6113,"context_line":"        # Second call has both"},{"line_number":6114,"context_line":"        call_args1 \u003d mock_get_arqs.call_args_list[1]"},{"line_number":6115,"context_line":"        self.assertEqual(len(call_args1), 2)"},{"line_number":6116,"context_line":"        self.assertEqual(call_args1.args[0], self.instance.uuid)"},{"line_number":6117,"context_line":"        self.assertEqual(call_args1.kwargs, {\u0027only_resolved\u0027: True})"},{"line_number":6118,"context_line":""},{"line_number":6119,"context_line":"        self.assertEqual(sorted(ret_arqs), sorted(arq_list))"},{"line_number":6120,"context_line":""}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_44837556","line":6117,"range":{"start_line":6108,"start_character":0,"end_line":6117,"end_character":68},"in_reply_to":"3fa7e38b_e1a4d3ba","updated":"2020-01-15 15:16:13.000000000","message":"Done","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"59972f9bfeb33055cf27ccb66e1ec3ba050c9a65","unresolved":false,"context_lines":[{"line_number":6105,"context_line":"        mock_exit_wait_early.assert_called_once_with(arq_events)"},{"line_number":6106,"context_line":""},{"line_number":6107,"context_line":"        self.assertEqual(mock_get_arqs.call_count, 2)"},{"line_number":6108,"context_line":"        # First call has instance.uuid but not only_resolved"},{"line_number":6109,"context_line":"        call_args0 \u003d mock_get_arqs.call_args_list[0]"},{"line_number":6110,"context_line":"        self.assertEqual(len(call_args0), 2)"},{"line_number":6111,"context_line":"        self.assertEqual(call_args0.args[0], self.instance.uuid)"},{"line_number":6112,"context_line":"        self.assertEqual(call_args0.kwargs, {})"},{"line_number":6113,"context_line":"        # Second call has both"},{"line_number":6114,"context_line":"        call_args1 \u003d mock_get_arqs.call_args_list[1]"},{"line_number":6115,"context_line":"        self.assertEqual(len(call_args1), 2)"},{"line_number":6116,"context_line":"        self.assertEqual(call_args1.args[0], self.instance.uuid)"},{"line_number":6117,"context_line":"        self.assertEqual(call_args1.kwargs, {\u0027only_resolved\u0027: True})"},{"line_number":6118,"context_line":""},{"line_number":6119,"context_line":"        self.assertEqual(sorted(ret_arqs), sorted(arq_list))"},{"line_number":6120,"context_line":""}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_e1a4d3ba","line":6117,"range":{"start_line":6108,"start_character":0,"end_line":6117,"end_character":68},"in_reply_to":"3fa7e38b_f4e012ce","updated":"2020-01-15 14:52:27.000000000","message":"Right, this is what I want and is massively easier to follow.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"4c92fa535a492d13651d3fd5c2ca40ea152ef7a2","unresolved":false,"context_lines":[{"line_number":6105,"context_line":"        mock_exit_wait_early.assert_called_once_with(arq_events)"},{"line_number":6106,"context_line":""},{"line_number":6107,"context_line":"        self.assertEqual(mock_get_arqs.call_count, 2)"},{"line_number":6108,"context_line":"        # First call has instance.uuid but not only_resolved"},{"line_number":6109,"context_line":"        call_args0 \u003d mock_get_arqs.call_args_list[0]"},{"line_number":6110,"context_line":"        self.assertEqual(len(call_args0), 2)"},{"line_number":6111,"context_line":"        self.assertEqual(call_args0.args[0], self.instance.uuid)"},{"line_number":6112,"context_line":"        self.assertEqual(call_args0.kwargs, {})"},{"line_number":6113,"context_line":"        # Second call has both"},{"line_number":6114,"context_line":"        call_args1 \u003d mock_get_arqs.call_args_list[1]"},{"line_number":6115,"context_line":"        self.assertEqual(len(call_args1), 2)"},{"line_number":6116,"context_line":"        self.assertEqual(call_args1.args[0], self.instance.uuid)"},{"line_number":6117,"context_line":"        self.assertEqual(call_args1.kwargs, {\u0027only_resolved\u0027: True})"},{"line_number":6118,"context_line":""},{"line_number":6119,"context_line":"        self.assertEqual(sorted(ret_arqs), sorted(arq_list))"},{"line_number":6120,"context_line":""}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_f4e012ce","line":6117,"range":{"start_line":6108,"start_character":0,"end_line":6117,"end_character":68},"in_reply_to":"3fa7e38b_fb9c210e","updated":"2020-01-15 13:49:05.000000000","message":"The parameter only_resolved is not passed in the first call, so this version fails assertions. However, the following does work:\n\n mock_get_arqs.assert_has_calls([\n            mock.call(self.instance.uuid),\n            mock.call(self.instance.uuid, only_resolved\u003dTrue)])","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"faa1d71ff475c4520ae46390e025c8e8c2106b9c","unresolved":false,"context_lines":[{"line_number":6134,"context_line":"                      for arq in arq_list]"},{"line_number":6135,"context_line":"        # get_arqs_for_instance gets called 3 times, returning the full"},{"line_number":6136,"context_line":"        # ARQ list first, [] as resolved ARQs next, and the full list finally"},{"line_number":6137,"context_line":"        mock_get_arqs.side_effect \u003d [arq_list, [], arq_list]"},{"line_number":6138,"context_line":""},{"line_number":6139,"context_line":"        ret_arqs \u003d self.compute._get_bound_arq_resources("},{"line_number":6140,"context_line":"            self.context, dp_name, self.instance)"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_3b65d91d","line":6137,"updated":"2020-01-02 16:53:44.000000000","message":"You should assert that the three calls are as you expect (with only_resolved being False, True, False) to make this tight enough to depend on.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"4c92fa535a492d13651d3fd5c2ca40ea152ef7a2","unresolved":false,"context_lines":[{"line_number":6134,"context_line":"                      for arq in arq_list]"},{"line_number":6135,"context_line":"        # get_arqs_for_instance gets called 3 times, returning the full"},{"line_number":6136,"context_line":"        # ARQ list first, [] as resolved ARQs next, and the full list finally"},{"line_number":6137,"context_line":"        mock_get_arqs.side_effect \u003d [arq_list, [], arq_list]"},{"line_number":6138,"context_line":""},{"line_number":6139,"context_line":"        ret_arqs \u003d self.compute._get_bound_arq_resources("},{"line_number":6140,"context_line":"            self.context, dp_name, self.instance)"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_2f7e576d","line":6137,"in_reply_to":"3fa7e38b_3b65d91d","updated":"2020-01-15 13:49:05.000000000","message":"Done","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"faa1d71ff475c4520ae46390e025c8e8c2106b9c","unresolved":false,"context_lines":[{"line_number":6165,"context_line":""},{"line_number":6166,"context_line":"        self.assertRaises(eventlet_timeout.Timeout,"},{"line_number":6167,"context_line":"            self.compute._get_bound_arq_resources,"},{"line_number":6168,"context_line":"            self.context, dp_name, self.instance)"},{"line_number":6169,"context_line":""},{"line_number":6170,"context_line":"        mock_wait_inst_ev.assert_called_once_with("},{"line_number":6171,"context_line":"            self.instance, arq_events, deadline\u003dmock.ANY)"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_7b4fd18b","line":6168,"updated":"2020-01-02 16:53:44.000000000","message":"I think this is maybe the wrong thing to use to trigger your test here. By mocking out the context call, you\u0027re not only not running any of your own code (in the context) but also skipping a bunch of compute manager code that will run in reality. Since the effect is the same, couldn\u0027t you make the second call to the get_arqs method raise some exception to test this case?","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"4c92fa535a492d13651d3fd5c2ca40ea152ef7a2","unresolved":false,"context_lines":[{"line_number":6165,"context_line":""},{"line_number":6166,"context_line":"        self.assertRaises(eventlet_timeout.Timeout,"},{"line_number":6167,"context_line":"            self.compute._get_bound_arq_resources,"},{"line_number":6168,"context_line":"            self.context, dp_name, self.instance)"},{"line_number":6169,"context_line":""},{"line_number":6170,"context_line":"        mock_wait_inst_ev.assert_called_once_with("},{"line_number":6171,"context_line":"            self.instance, arq_events, deadline\u003dmock.ANY)"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_ef535fdd","line":6168,"in_reply_to":"3fa7e38b_7b4fd18b","updated":"2020-01-15 13:49:05.000000000","message":"The code actually handles 2 exceptions [1]: Exception and eventlet.timeout.Timeout. I think the timeout case must be tested as well.\n\nI think what you are saying is that the case of an exception being thrown inside the context is not getting tested here. If so, I agree and I can add that. I didn\u0027t add it earlier because the effect is the same, as you noted, but it is probably worth doing both.\n\n[1] https://review.opendev.org/#/c/631244/53/nova/compute/manager.py@2678","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"de51d74be4f298607f844c9eaf62341543b88a8a","unresolved":false,"context_lines":[{"line_number":6165,"context_line":""},{"line_number":6166,"context_line":"        self.assertRaises(eventlet_timeout.Timeout,"},{"line_number":6167,"context_line":"            self.compute._get_bound_arq_resources,"},{"line_number":6168,"context_line":"            self.context, dp_name, self.instance)"},{"line_number":6169,"context_line":""},{"line_number":6170,"context_line":"        mock_wait_inst_ev.assert_called_once_with("},{"line_number":6171,"context_line":"            self.instance, arq_events, deadline\u003dmock.ANY)"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_047d7d6c","line":6168,"in_reply_to":"3fa7e38b_c18bd71f","updated":"2020-01-15 15:16:13.000000000","message":"Done","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"59972f9bfeb33055cf27ccb66e1ec3ba050c9a65","unresolved":false,"context_lines":[{"line_number":6165,"context_line":""},{"line_number":6166,"context_line":"        self.assertRaises(eventlet_timeout.Timeout,"},{"line_number":6167,"context_line":"            self.compute._get_bound_arq_resources,"},{"line_number":6168,"context_line":"            self.context, dp_name, self.instance)"},{"line_number":6169,"context_line":""},{"line_number":6170,"context_line":"        mock_wait_inst_ev.assert_called_once_with("},{"line_number":6171,"context_line":"            self.instance, arq_events, deadline\u003dmock.ANY)"}],"source_content_type":"text/x-python","patch_set":53,"id":"3fa7e38b_c18bd71f","line":6168,"in_reply_to":"3fa7e38b_ef535fdd","updated":"2020-01-15 14:52:27.000000000","message":"Yep, agree.","commit_id":"e92099a27b7791ed97aed82d34bf116f94e4c848"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e9ab5039ae6407f41bb864bf54b2311409906e12","unresolved":false,"context_lines":[{"line_number":6030,"context_line":"        self.instance.flavor.extra_specs \u003d {}"},{"line_number":6031,"context_line":"        _, got_exception, _ \u003d self._test_accel_build_resources()"},{"line_number":6032,"context_line":"        mock_get_arqs.assert_not_called()"},{"line_number":6033,"context_line":"        self.assertFalse(got_exception)"},{"line_number":6034,"context_line":""},{"line_number":6035,"context_line":"    @mock.patch.object(nova.compute.manager.ComputeManager,"},{"line_number":6036,"context_line":"                       \u0027_get_bound_arq_resources\u0027)"}],"source_content_type":"text/x-python","patch_set":55,"id":"3fa7e38b_fd7364e3","line":6033,"updated":"2020-01-28 19:36:04.000000000","message":"If this starts failing, it will report \"Test failed: false is not true\" which isn\u0027t super useful. Why not just remove the exception handler in the inner method and run the inner with self.assertRaises() in the cases where you expect it to? That way if the non-error cases raise, we see the actual exception, and if the exception stops being raised, the test will report \"expected to raise $exception but did not\".","commit_id":"109e874946a4fafacfbd70753b47c2a840c8a1f8"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"715188d9edafcba03bbe7123e816f55189773ee9","unresolved":false,"context_lines":[{"line_number":6030,"context_line":"        self.instance.flavor.extra_specs \u003d {}"},{"line_number":6031,"context_line":"        _, got_exception, _ \u003d self._test_accel_build_resources()"},{"line_number":6032,"context_line":"        mock_get_arqs.assert_not_called()"},{"line_number":6033,"context_line":"        self.assertFalse(got_exception)"},{"line_number":6034,"context_line":""},{"line_number":6035,"context_line":"    @mock.patch.object(nova.compute.manager.ComputeManager,"},{"line_number":6036,"context_line":"                       \u0027_get_bound_arq_resources\u0027)"}],"source_content_type":"text/x-python","patch_set":55,"id":"3fa7e38b_aa6cab6b","line":6033,"in_reply_to":"3fa7e38b_fd7364e3","updated":"2020-01-30 04:14:04.000000000","message":"Done","commit_id":"109e874946a4fafacfbd70753b47c2a840c8a1f8"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e9ab5039ae6407f41bb864bf54b2311409906e12","unresolved":false,"context_lines":[{"line_number":6082,"context_line":"        ret_arqs \u003d self.compute._get_bound_arq_resources("},{"line_number":6083,"context_line":"            self.context, dp_name, self.instance)"},{"line_number":6084,"context_line":""},{"line_number":6085,"context_line":"        mock_wait_inst_ev.assert_called_once_with("},{"line_number":6086,"context_line":"            self.instance, arq_events, deadline\u003dmock.ANY)"},{"line_number":6087,"context_line":"        mock_exit_wait_early.assert_called_once_with(arq_events)"},{"line_number":6088,"context_line":""}],"source_content_type":"text/x-python","patch_set":55,"id":"3fa7e38b_5d0cf842","line":6085,"updated":"2020-01-28 19:36:04.000000000","message":"I was concerned about mocking this, but MagicMock does seem to yield on __enter__ so I guess this works. It does cut out a bunch of the code interaction you\u0027re trying to test here, even though I know the point is to make sure we called exit_early. I\u0027m not sure how I feel about this, but not -1ing for it.","commit_id":"109e874946a4fafacfbd70753b47c2a840c8a1f8"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"715188d9edafcba03bbe7123e816f55189773ee9","unresolved":false,"context_lines":[{"line_number":6082,"context_line":"        ret_arqs \u003d self.compute._get_bound_arq_resources("},{"line_number":6083,"context_line":"            self.context, dp_name, self.instance)"},{"line_number":6084,"context_line":""},{"line_number":6085,"context_line":"        mock_wait_inst_ev.assert_called_once_with("},{"line_number":6086,"context_line":"            self.instance, arq_events, deadline\u003dmock.ANY)"},{"line_number":6087,"context_line":"        mock_exit_wait_early.assert_called_once_with(arq_events)"},{"line_number":6088,"context_line":""}],"source_content_type":"text/x-python","patch_set":55,"id":"3fa7e38b_4abf3779","line":6085,"in_reply_to":"3fa7e38b_5d0cf842","updated":"2020-01-30 04:14:04.000000000","message":"Yes, the focus is on exit_early. Thanks.","commit_id":"109e874946a4fafacfbd70753b47c2a840c8a1f8"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e9ab5039ae6407f41bb864bf54b2311409906e12","unresolved":false,"context_lines":[{"line_number":6138,"context_line":"                      for arq in arq_list]"},{"line_number":6139,"context_line":""},{"line_number":6140,"context_line":"        mock_get_arqs.return_value \u003d arq_list"},{"line_number":6141,"context_line":"        mock_wait_inst_ev.side_effect \u003d eventlet_timeout.Timeout"},{"line_number":6142,"context_line":""},{"line_number":6143,"context_line":"        self.assertRaises(eventlet_timeout.Timeout,"},{"line_number":6144,"context_line":"            self.compute._get_bound_arq_resources,"}],"source_content_type":"text/x-python","patch_set":55,"id":"3fa7e38b_fdfa840f","line":6141,"updated":"2020-01-28 19:36:04.000000000","message":"I think this should actually be:\n\n mock_wait_inst_ev.return_value.__enter__.side_effect \u003d $exception\n\nBecause the exception is thrown during the yield and not when it\u0027s called. AFAIK, what you have here will execute before the with statement and blow up then. Not sure it matters for the way the code currently works, but what you have here is not really correct.","commit_id":"109e874946a4fafacfbd70753b47c2a840c8a1f8"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"715188d9edafcba03bbe7123e816f55189773ee9","unresolved":false,"context_lines":[{"line_number":6138,"context_line":"                      for arq in arq_list]"},{"line_number":6139,"context_line":""},{"line_number":6140,"context_line":"        mock_get_arqs.return_value \u003d arq_list"},{"line_number":6141,"context_line":"        mock_wait_inst_ev.side_effect \u003d eventlet_timeout.Timeout"},{"line_number":6142,"context_line":""},{"line_number":6143,"context_line":"        self.assertRaises(eventlet_timeout.Timeout,"},{"line_number":6144,"context_line":"            self.compute._get_bound_arq_resources,"}],"source_content_type":"text/x-python","patch_set":55,"id":"3fa7e38b_ca9a4760","line":6141,"in_reply_to":"3fa7e38b_fdfa840f","updated":"2020-01-30 04:14:04.000000000","message":"Done","commit_id":"109e874946a4fafacfbd70753b47c2a840c8a1f8"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"23a64313d3acef9ac99b0b40a93545acb0c2b25b","unresolved":false,"context_lines":[{"line_number":6067,"context_line":"        dp_name \u003d fixtures.CyborgFixture.dp_name"},{"line_number":6068,"context_line":"        arq_list \u003d fixtures.CyborgFixture.bound_arq_list"},{"line_number":6069,"context_line":"        self.instance.flavor.extra_specs \u003d {\"accel:device_profile\": dp_name}"},{"line_number":6070,"context_line":"        arq_events \u003d [(\u0027accelerator-request-bound\u0027, arq[\u0027uuid\u0027])"},{"line_number":6071,"context_line":"                      for arq in arq_list]"},{"line_number":6072,"context_line":""},{"line_number":6073,"context_line":"        # get_arqs_for_instance() is called twice, once to get all ARQs"},{"line_number":6074,"context_line":"        # for the instance, once to get only the resolved ARQs"},{"line_number":6075,"context_line":"        mock_get_arqs.return_value \u003d arq_list"},{"line_number":6076,"context_line":""},{"line_number":6077,"context_line":"        ret_arqs \u003d self.compute._get_bound_arq_resources("},{"line_number":6078,"context_line":"            self.context, dp_name, self.instance)"},{"line_number":6079,"context_line":""},{"line_number":6080,"context_line":"        mock_wait_inst_ev.assert_called_once_with("},{"line_number":6081,"context_line":"            self.instance, arq_events, deadline\u003dmock.ANY)"},{"line_number":6082,"context_line":"        mock_exit_wait_early.assert_called_once_with(arq_events)"},{"line_number":6083,"context_line":""},{"line_number":6084,"context_line":"        mock_get_arqs.assert_has_calls(["},{"line_number":6085,"context_line":"            mock.call(self.instance.uuid),"}],"source_content_type":"text/x-python","patch_set":69,"id":"df33271e_07915f53","line":6082,"range":{"start_line":6070,"start_character":7,"end_line":6082,"end_character":64},"updated":"2020-03-23 17:30:23.000000000","message":"ok so what this is telling me is the default behavior of the fixture is to return all the arqs as bound so im expecting the  next version to bock this so only some of the requests are bound on the first call.","commit_id":"cc630b4eb62c4a45ff08a1862a8339a0f129e0a3"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"23a64313d3acef9ac99b0b40a93545acb0c2b25b","unresolved":false,"context_lines":[{"line_number":6101,"context_line":"        self.instance.flavor.extra_specs \u003d {\"accel:device_profile\": dp_name}"},{"line_number":6102,"context_line":"        arq_events \u003d [(\u0027accelerator-request-bound\u0027, arq[\u0027uuid\u0027])"},{"line_number":6103,"context_line":"                      for arq in arq_list]"},{"line_number":6104,"context_line":"        # get_arqs_for_instance gets called 3 times, returning the full"},{"line_number":6105,"context_line":"        # ARQ list first, [] as resolved ARQs next, and the full list finally"},{"line_number":6106,"context_line":"        mock_get_arqs.side_effect \u003d [arq_list, [], arq_list]"},{"line_number":6107,"context_line":""},{"line_number":6108,"context_line":"        ret_arqs \u003d self.compute._get_bound_arq_resources("},{"line_number":6109,"context_line":"            self.context, dp_name, self.instance)"}],"source_content_type":"text/x-python","patch_set":69,"id":"df33271e_277d831c","line":6106,"range":{"start_line":6104,"start_character":7,"end_line":6106,"end_character":60},"updated":"2020-03-23 17:30:23.000000000","message":"ok cool so this is where that is mocked.\n\nas a minor nit instead of or after returning [] i might have done something like\n \narq_list[:len(arq_list)/2]\n\nto have a partial responce\n\nbut i think this is also fine.","commit_id":"cc630b4eb62c4a45ff08a1862a8339a0f129e0a3"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"23a64313d3acef9ac99b0b40a93545acb0c2b25b","unresolved":false,"context_lines":[{"line_number":6112,"context_line":"            self.instance, arq_events, deadline\u003dmock.ANY)"},{"line_number":6113,"context_line":"        mock_exit_wait_early.assert_not_called()"},{"line_number":6114,"context_line":"        self.assertEqual(sorted(ret_arqs), sorted(arq_list))"},{"line_number":6115,"context_line":"        mock_get_arqs.assert_has_calls(["},{"line_number":6116,"context_line":"            mock.call(self.instance.uuid),"},{"line_number":6117,"context_line":"            mock.call(self.instance.uuid, only_resolved\u003dTrue),"},{"line_number":6118,"context_line":"            mock.call(self.instance.uuid)])"},{"line_number":6119,"context_line":""},{"line_number":6120,"context_line":"    @mock.patch.object(nova.compute.manager.ComputeVirtAPI,"},{"line_number":6121,"context_line":"                       \u0027exit_wait_early\u0027)"}],"source_content_type":"text/x-python","patch_set":69,"id":"df33271e_07f67f90","line":6118,"range":{"start_line":6115,"start_character":8,"end_line":6118,"end_character":43},"updated":"2020-03-23 17:30:23.000000000","message":"and here you have asserted it was called 3 times which makes sense.","commit_id":"cc630b4eb62c4a45ff08a1862a8339a0f129e0a3"}],"nova/tests/unit/conductor/test_conductor.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"2e9e209090957647e806fde5e77551e29b68a88f","unresolved":false,"context_lines":[{"line_number":1878,"context_line":"        mock_create.assert_called_once_with(dp_name, mock.ANY)"},{"line_number":1879,"context_line":"        mock_bind.assert_called_once()  # Args checked below"},{"line_number":1880,"context_line":""},{"line_number":1881,"context_line":"        bindings \u003d mock_bind.call_args[1][\u0027bindings\u0027]"},{"line_number":1882,"context_line":"        in_arq_uuids \u003d [arq[\u0027uuid\u0027] for arq in in_arq_list]"},{"line_number":1883,"context_line":"        called_arq_uuids \u003d list(bindings.keys())"},{"line_number":1884,"context_line":"        # All and only ARQs created by \u0027create_arqs_..\u0027 are passed to bind"},{"line_number":1885,"context_line":"        self.assertEqual(sorted(in_arq_uuids), sorted(called_arq_uuids))"},{"line_number":1886,"context_line":"        # All bindings must have same host and instance_uuid."},{"line_number":1887,"context_line":"        # Note that device_rp_uuid need not be the same, i.e., ARQs for"},{"line_number":1888,"context_line":"        # an instance may be bound to different devices in the same host."},{"line_number":1889,"context_line":"        host_set \u003d {val[\u0027hostname\u0027] for val in bindings.values()}"},{"line_number":1890,"context_line":"        self.assertEqual(host_set, {\u0027myhost\u0027})"},{"line_number":1891,"context_line":"        instance_set \u003d {val[\u0027instance_uuid\u0027] for val in bindings.values()}"},{"line_number":1892,"context_line":"        self.assertEqual(instance_set, {instance.uuid})"},{"line_number":1893,"context_line":""},{"line_number":1894,"context_line":"    @mock.patch(\u0027nova.availability_zones.get_host_availability_zone\u0027)"},{"line_number":1895,"context_line":"    @mock.patch(\u0027nova.compute.rpcapi.ComputeAPI.build_and_run_instance\u0027)"}],"source_content_type":"text/x-python","patch_set":54,"id":"3fa7e38b_624befb1","line":1892,"range":{"start_line":1881,"start_character":8,"end_line":1892,"end_character":55},"updated":"2020-01-16 16:23:46.000000000","message":"Why are you not using assert_called_once_with? You should be able to synthesize the dict that bindings\u003d should be called with, so this would collapse down to one line other than that. IMHO, the only reason it\u0027s legit to inspect the argspec directly like this is if you have some argument in there that really can\u0027t be known ahead of time. Even then, I would expect mock.ANY for that arg in a call assertion and then a targeted evaluation of that arg by direct inspection.\n\nWhat you have here is just hard to validate that you\u0027re fully checking all of the args of the call, and it\u0027s fragile and hard to update in the future when the call changes.","commit_id":"ecf94f0e8431d8e1b6c04cd66fa13ad53212f0c3"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"a881a60fe2d8f71748785270b163f8125847c1a1","unresolved":false,"context_lines":[{"line_number":1878,"context_line":"        mock_create.assert_called_once_with(dp_name, mock.ANY)"},{"line_number":1879,"context_line":"        mock_bind.assert_called_once()  # Args checked below"},{"line_number":1880,"context_line":""},{"line_number":1881,"context_line":"        bindings \u003d mock_bind.call_args[1][\u0027bindings\u0027]"},{"line_number":1882,"context_line":"        in_arq_uuids \u003d [arq[\u0027uuid\u0027] for arq in in_arq_list]"},{"line_number":1883,"context_line":"        called_arq_uuids \u003d list(bindings.keys())"},{"line_number":1884,"context_line":"        # All and only ARQs created by \u0027create_arqs_..\u0027 are passed to bind"},{"line_number":1885,"context_line":"        self.assertEqual(sorted(in_arq_uuids), sorted(called_arq_uuids))"},{"line_number":1886,"context_line":"        # All bindings must have same host and instance_uuid."},{"line_number":1887,"context_line":"        # Note that device_rp_uuid need not be the same, i.e., ARQs for"},{"line_number":1888,"context_line":"        # an instance may be bound to different devices in the same host."},{"line_number":1889,"context_line":"        host_set \u003d {val[\u0027hostname\u0027] for val in bindings.values()}"},{"line_number":1890,"context_line":"        self.assertEqual(host_set, {\u0027myhost\u0027})"},{"line_number":1891,"context_line":"        instance_set \u003d {val[\u0027instance_uuid\u0027] for val in bindings.values()}"},{"line_number":1892,"context_line":"        self.assertEqual(instance_set, {instance.uuid})"},{"line_number":1893,"context_line":""},{"line_number":1894,"context_line":"    @mock.patch(\u0027nova.availability_zones.get_host_availability_zone\u0027)"},{"line_number":1895,"context_line":"    @mock.patch(\u0027nova.compute.rpcapi.ComputeAPI.build_and_run_instance\u0027)"}],"source_content_type":"text/x-python","patch_set":54,"id":"3fa7e38b_8f492f30","line":1892,"range":{"start_line":1881,"start_character":8,"end_line":1892,"end_character":55},"in_reply_to":"3fa7e38b_624befb1","updated":"2020-01-26 01:11:27.000000000","message":"Done","commit_id":"ecf94f0e8431d8e1b6c04cd66fa13ad53212f0c3"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"2e9e209090957647e806fde5e77551e29b68a88f","unresolved":false,"context_lines":[{"line_number":2440,"context_line":"        self._do_schedule_and_build_instances_with_arqs(params)"},{"line_number":2441,"context_line":""},{"line_number":2442,"context_line":"        # TODO(Sundar): Checking for instance/host causes Placement err."},{"line_number":2443,"context_line":"        mock_create_bind_arqs.assert_called_once()"},{"line_number":2444,"context_line":""},{"line_number":2445,"context_line":"    @mock.patch.object(conductor_manager.ComputeTaskManager,"},{"line_number":2446,"context_line":"                       \u0027_cleanup_build_artifacts\u0027)"}],"source_content_type":"text/x-python","patch_set":54,"id":"3fa7e38b_c2b8a379","line":2443,"updated":"2020-01-16 16:23:46.000000000","message":"Yeah, this doesn\u0027t really validate anything other than that it\u0027s called.","commit_id":"ecf94f0e8431d8e1b6c04cd66fa13ad53212f0c3"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"a881a60fe2d8f71748785270b163f8125847c1a1","unresolved":false,"context_lines":[{"line_number":2440,"context_line":"        self._do_schedule_and_build_instances_with_arqs(params)"},{"line_number":2441,"context_line":""},{"line_number":2442,"context_line":"        # TODO(Sundar): Checking for instance/host causes Placement err."},{"line_number":2443,"context_line":"        mock_create_bind_arqs.assert_called_once()"},{"line_number":2444,"context_line":""},{"line_number":2445,"context_line":"    @mock.patch.object(conductor_manager.ComputeTaskManager,"},{"line_number":2446,"context_line":"                       \u0027_cleanup_build_artifacts\u0027)"}],"source_content_type":"text/x-python","patch_set":54,"id":"3fa7e38b_af466b21","line":2443,"in_reply_to":"3fa7e38b_c2b8a379","updated":"2020-01-26 01:11:27.000000000","message":"Done","commit_id":"ecf94f0e8431d8e1b6c04cd66fa13ad53212f0c3"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"2e9e209090957647e806fde5e77551e29b68a88f","unresolved":false,"context_lines":[{"line_number":2458,"context_line":"        except exc.AcceleratorRequestOpFailed:"},{"line_number":2459,"context_line":"            pass"},{"line_number":2460,"context_line":""},{"line_number":2461,"context_line":"        mock_cleanup.assert_called_once()"},{"line_number":2462,"context_line":""},{"line_number":2463,"context_line":"    def test_map_instance_to_cell_already_mapped(self):"},{"line_number":2464,"context_line":"        \"\"\"Tests a scenario where an instance is already mapped to a cell"}],"source_content_type":"text/x-python","patch_set":54,"id":"3fa7e38b_e2bb5f71","line":2461,"updated":"2020-01-16 16:23:46.000000000","message":"This too.","commit_id":"ecf94f0e8431d8e1b6c04cd66fa13ad53212f0c3"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"a881a60fe2d8f71748785270b163f8125847c1a1","unresolved":false,"context_lines":[{"line_number":2458,"context_line":"        except exc.AcceleratorRequestOpFailed:"},{"line_number":2459,"context_line":"            pass"},{"line_number":2460,"context_line":""},{"line_number":2461,"context_line":"        mock_cleanup.assert_called_once()"},{"line_number":2462,"context_line":""},{"line_number":2463,"context_line":"    def test_map_instance_to_cell_already_mapped(self):"},{"line_number":2464,"context_line":"        \"\"\"Tests a scenario where an instance is already mapped to a cell"}],"source_content_type":"text/x-python","patch_set":54,"id":"3fa7e38b_cf43a710","line":2461,"in_reply_to":"3fa7e38b_e2bb5f71","updated":"2020-01-26 01:11:27.000000000","message":"Done","commit_id":"ecf94f0e8431d8e1b6c04cd66fa13ad53212f0c3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6eaebb09d169b5c83b60e330286959b0e740144f","unresolved":false,"context_lines":[{"line_number":578,"context_line":"        self.useFixture(cast_as_call.CastAsCall(self))"},{"line_number":579,"context_line":""},{"line_number":580,"context_line":"        mock_getaz.return_value \u003d \u0027myaz\u0027"},{"line_number":581,"context_line":"        mock_create_bind_arqs.side_effect \u003d exc.NovaException"},{"line_number":582,"context_line":""},{"line_number":583,"context_line":"        self.conductor.build_instances(self.context,"},{"line_number":584,"context_line":"                instances\u003dinstances,"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_135f9d72","line":581,"range":{"start_line":581,"start_character":44,"end_line":581,"end_character":61},"updated":"2020-03-04 14:25:17.000000000","message":"Could you please use a specific exception that the actual call can raise? That would make the unit test more realistic.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"65d58351bad22fa57836ac9400ede66b75b19654","unresolved":false,"context_lines":[{"line_number":578,"context_line":"        self.useFixture(cast_as_call.CastAsCall(self))"},{"line_number":579,"context_line":""},{"line_number":580,"context_line":"        mock_getaz.return_value \u003d \u0027myaz\u0027"},{"line_number":581,"context_line":"        mock_create_bind_arqs.side_effect \u003d exc.NovaException"},{"line_number":582,"context_line":""},{"line_number":583,"context_line":"        self.conductor.build_instances(self.context,"},{"line_number":584,"context_line":"                instances\u003dinstances,"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_b910b04f","line":581,"range":{"start_line":581,"start_character":44,"end_line":581,"end_character":61},"in_reply_to":"1fa4df85_135f9d72","updated":"2020-03-08 23:24:35.000000000","message":"Done","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6eaebb09d169b5c83b60e330286959b0e740144f","unresolved":false,"context_lines":[{"line_number":597,"context_line":"                      instances[1].flavor.extra_specs, \u0027node2\u0027, mock.ANY),"},{"line_number":598,"context_line":"            ])"},{"line_number":599,"context_line":"        # Comparing instances fails because the instance objects have changed"},{"line_number":600,"context_line":"        # in the above flow. So, we compare the fields instead."},{"line_number":601,"context_line":"        mock_cleanup.assert_has_calls(["},{"line_number":602,"context_line":"            mock.call(self.context, test.MatchType(objects.Instance),"},{"line_number":603,"context_line":"                      test.MatchType(exc.NovaException),"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_734db1c2","line":600,"range":{"start_line":600,"start_character":28,"end_line":600,"end_character":62},"updated":"2020-03-04 14:25:17.000000000","message":"you actually compare only the type not any of the fields of the object.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"65d58351bad22fa57836ac9400ede66b75b19654","unresolved":false,"context_lines":[{"line_number":597,"context_line":"                      instances[1].flavor.extra_specs, \u0027node2\u0027, mock.ANY),"},{"line_number":598,"context_line":"            ])"},{"line_number":599,"context_line":"        # Comparing instances fails because the instance objects have changed"},{"line_number":600,"context_line":"        # in the above flow. So, we compare the fields instead."},{"line_number":601,"context_line":"        mock_cleanup.assert_has_calls(["},{"line_number":602,"context_line":"            mock.call(self.context, test.MatchType(objects.Instance),"},{"line_number":603,"context_line":"                      test.MatchType(exc.NovaException),"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_f90aa81d","line":600,"range":{"start_line":600,"start_character":28,"end_line":600,"end_character":62},"in_reply_to":"1fa4df85_734db1c2","updated":"2020-03-08 23:24:35.000000000","message":"Hmm, in L610-613, we compare the UUID and extra specs fields of the instance objects.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"cd157bf1019f7e268897eeb4d6b98ce5e47049fe","unresolved":false,"context_lines":[{"line_number":597,"context_line":"                      instances[1].flavor.extra_specs, \u0027node2\u0027, mock.ANY),"},{"line_number":598,"context_line":"            ])"},{"line_number":599,"context_line":"        # Comparing instances fails because the instance objects have changed"},{"line_number":600,"context_line":"        # in the above flow. So, we compare the fields instead."},{"line_number":601,"context_line":"        mock_cleanup.assert_has_calls(["},{"line_number":602,"context_line":"            mock.call(self.context, test.MatchType(objects.Instance),"},{"line_number":603,"context_line":"                      test.MatchType(exc.NovaException),"}],"source_content_type":"text/x-python","patch_set":65,"id":"1fa4df85_409de607","line":600,"range":{"start_line":600,"start_character":28,"end_line":600,"end_character":62},"in_reply_to":"1fa4df85_f90aa81d","updated":"2020-03-10 17:17:27.000000000","message":"You are right. I missed the call_arg_list check below.","commit_id":"4f8edf2b50d0b669053dacb55dbeb28a451df9d6"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"2396ecdbb33df493c6d3889bf7dd61aa21b7a670","unresolved":false,"context_lines":[{"line_number":599,"context_line":"            ])"},{"line_number":600,"context_line":"        # Comparing instances fails because the instance objects have changed"},{"line_number":601,"context_line":"        # in the above flow. So, we compare the fields instead."},{"line_number":602,"context_line":"        mock_cleanup.assert_has_calls(["},{"line_number":603,"context_line":"            mock.call(self.context, test.MatchType(objects.Instance),"},{"line_number":604,"context_line":"                      test.MatchType(exc.AcceleratorRequestOpFailed),"},{"line_number":605,"context_line":"                      test.MatchType(dict), None),"}],"source_content_type":"text/x-python","patch_set":68,"id":"1fa4df85_b43ebcb5","line":602,"updated":"2020-03-20 08:13:16.000000000","message":"it will be great this test case, ensure we are going to fail directly or retry next host.","commit_id":"70c6aa219043cf8dd05c4ff9c23dcbbf1c102b20"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"23a64313d3acef9ac99b0b40a93545acb0c2b25b","unresolved":false,"context_lines":[{"line_number":574,"context_line":"        sched_return \u003d copy.deepcopy(fake_host_lists2)"},{"line_number":575,"context_line":"        mock_schedule.return_value \u003d sched_return"},{"line_number":576,"context_line":""},{"line_number":577,"context_line":"        # build_instances() is a cast, we need to wait for it to complete"},{"line_number":578,"context_line":"        self.useFixture(cast_as_call.CastAsCall(self))"},{"line_number":579,"context_line":""},{"line_number":580,"context_line":"        mock_getaz.return_value \u003d \u0027myaz\u0027"},{"line_number":581,"context_line":"        mock_create_bind_arqs.side_effect \u003d ("}],"source_content_type":"text/x-python","patch_set":69,"id":"df33271e_877d6fe9","line":578,"range":{"start_line":577,"start_character":2,"end_line":578,"end_character":54},"updated":"2020-03-23 17:30:23.000000000","message":"am lets not dwell on this too much but i think we are not ment to do this anymore.\n\ni know mriedem has advised me to avoid CastAsCall in the past and fixtures that use it but i dont know if that was in general or just in the funtional tests to try and keep them more realistic.","commit_id":"cc630b4eb62c4a45ff08a1862a8339a0f129e0a3"}]}
