)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"58ffde38a15014c99fbaeb415650b60c93bca251","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Error out interrupted builds"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If the compute service is restarted while build build requests are"},{"line_number":10,"context_line":"executing the instance_claim or waiting for the COMPUTE_RESOURCE_SEMAPHORE"},{"line_number":11,"context_line":"then those instances will stuck forever in BUILDING state. If the instance"},{"line_number":12,"context_line":"already finished instance_claim then instance.host is set and when the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9fb8cfa7_19479379","line":9,"range":{"start_line":9,"start_character":42,"end_line":9,"end_character":47},"updated":"2019-06-27 19:54:03.000000000","message":"strike","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"faeb7eeb5d897f3200d6b47dcfab63df98a0df84","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Error out interrupted builds"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If the compute service is restarted while build build requests are"},{"line_number":10,"context_line":"executing the instance_claim or waiting for the COMPUTE_RESOURCE_SEMAPHORE"},{"line_number":11,"context_line":"then those instances will stuck forever in BUILDING state. If the instance"},{"line_number":12,"context_line":"already finished instance_claim then instance.host is set and when the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"7faddb67_cde1e100","line":9,"range":{"start_line":9,"start_character":42,"end_line":9,"end_character":47},"in_reply_to":"9fb8cfa7_19479379","updated":"2019-07-05 13:08:54.000000000","message":"Done","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"58ffde38a15014c99fbaeb415650b60c93bca251","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If the compute service is restarted while build build requests are"},{"line_number":10,"context_line":"executing the instance_claim or waiting for the COMPUTE_RESOURCE_SEMAPHORE"},{"line_number":11,"context_line":"then those instances will stuck forever in BUILDING state. If the instance"},{"line_number":12,"context_line":"already finished instance_claim then instance.host is set and when the"},{"line_number":13,"context_line":"compute restarts the instance is put to ERROR state."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9fb8cfa7_d95c9b4c","line":11,"range":{"start_line":11,"start_character":21,"end_line":11,"end_character":31},"updated":"2019-06-27 19:54:03.000000000","message":"will be stuck","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"faeb7eeb5d897f3200d6b47dcfab63df98a0df84","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If the compute service is restarted while build build requests are"},{"line_number":10,"context_line":"executing the instance_claim or waiting for the COMPUTE_RESOURCE_SEMAPHORE"},{"line_number":11,"context_line":"then those instances will stuck forever in BUILDING state. If the instance"},{"line_number":12,"context_line":"already finished instance_claim then instance.host is set and when the"},{"line_number":13,"context_line":"compute restarts the instance is put to ERROR state."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"7faddb67_8de3e905","line":11,"range":{"start_line":11,"start_character":21,"end_line":11,"end_character":31},"in_reply_to":"9fb8cfa7_d95c9b4c","updated":"2019-07-05 13:08:54.000000000","message":"Done","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"58ffde38a15014c99fbaeb415650b60c93bca251","unresolved":false,"context_lines":[{"line_number":12,"context_line":"already finished instance_claim then instance.host is set and when the"},{"line_number":13,"context_line":"compute restarts the instance is put to ERROR state."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This patch ensures that the instances that are in BUILDING state, has"},{"line_number":16,"context_line":"allocation towards the compute but the instance.host is not set to that"},{"line_number":17,"context_line":"compute are also put in ERROR state during compute service startup."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I856a3032c83fc2f605d8c9b6e5aa3bcfa415f96a"},{"line_number":20,"context_line":"Closes-Bug: #1833581"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9fb8cfa7_391cd776","line":17,"range":{"start_line":15,"start_character":0,"end_line":17,"end_character":67},"updated":"2019-06-27 19:54:03.000000000","message":"Suggest reword (assuming I\u0027m interpreting this correctly):\n\nThis patch changes compute service startup to put instances into ERROR state if they a) are in the BUILDING state, and b) have allocations on the compute, but c) do not have instance.host set to that compute.","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"faeb7eeb5d897f3200d6b47dcfab63df98a0df84","unresolved":false,"context_lines":[{"line_number":12,"context_line":"already finished instance_claim then instance.host is set and when the"},{"line_number":13,"context_line":"compute restarts the instance is put to ERROR state."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This patch ensures that the instances that are in BUILDING state, has"},{"line_number":16,"context_line":"allocation towards the compute but the instance.host is not set to that"},{"line_number":17,"context_line":"compute are also put in ERROR state during compute service startup."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I856a3032c83fc2f605d8c9b6e5aa3bcfa415f96a"},{"line_number":20,"context_line":"Closes-Bug: #1833581"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"7faddb67_2df0b5c9","line":17,"range":{"start_line":15,"start_character":0,"end_line":17,"end_character":67},"in_reply_to":"9fb8cfa7_391cd776","updated":"2019-07-05 13:08:54.000000000","message":"Done","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bfaec897ef89cb858b038b5b08e48ed3925245f2","unresolved":false,"context_lines":[{"line_number":15,"context_line":"This patch changes compute service startup to put instances into"},{"line_number":16,"context_line":"ERROR state if they a) are in the BUILDING state, and b) have"},{"line_number":17,"context_line":"allocations on the compute resource provider, but c) do not have"},{"line_number":18,"context_line":"instance.host set to that compute."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Change-Id: I856a3032c83fc2f605d8c9b6e5aa3bcfa415f96a"},{"line_number":21,"context_line":"Closes-Bug: #1833581"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"7faddb67_8bd40abf","line":18,"updated":"2019-07-09 11:54:46.000000000","message":"Unfortunately this condition is true for an instance where the instance build request is still traveling from the conductor to the compute via AMQP when the compute is restarted. In this case pushing the such instance to ERROR state is a mistake as such a request will be handled by the compute properly after the startup.","commit_id":"05992960e6ea4add6e3c256978907bbcdecbd7dc"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"7b3d12e5beef849030e6c2bbb47fc5e463aff4a1","unresolved":false,"context_lines":[{"line_number":15,"context_line":"This patch changes compute service startup to put instances into"},{"line_number":16,"context_line":"ERROR state if they a) are in the BUILDING state, and b) have"},{"line_number":17,"context_line":"allocations on the compute resource provider, but c) do not have"},{"line_number":18,"context_line":"instance.host set to that compute."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Change-Id: I856a3032c83fc2f605d8c9b6e5aa3bcfa415f96a"},{"line_number":21,"context_line":"Closes-Bug: #1833581"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"7faddb67_a2b41cd2","line":18,"in_reply_to":"7faddb67_0f8ebb2d","updated":"2019-07-16 11:49:18.000000000","message":"Ohh I was mistaken. The nova-compute service puts the instance to BUILDING state [1] _after_ the build request is received. So the problem I mentioned above does not exists.\n\n[1] https://github.com/openstack/nova/blob/03753b219e3025c6dc26fa00a77312470e970d37/nova/compute/manager.py#L1956","commit_id":"05992960e6ea4add6e3c256978907bbcdecbd7dc"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"3546f9fb0c0eb5b72cdca852ce1d01cd43455499","unresolved":false,"context_lines":[{"line_number":15,"context_line":"This patch changes compute service startup to put instances into"},{"line_number":16,"context_line":"ERROR state if they a) are in the BUILDING state, and b) have"},{"line_number":17,"context_line":"allocations on the compute resource provider, but c) do not have"},{"line_number":18,"context_line":"instance.host set to that compute."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Change-Id: I856a3032c83fc2f605d8c9b6e5aa3bcfa415f96a"},{"line_number":21,"context_line":"Closes-Bug: #1833581"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"7faddb67_0f8ebb2d","line":18,"in_reply_to":"7faddb67_8bd40abf","updated":"2019-07-11 10:49:54.000000000","message":"maybe it\u0027d be possible to introduce some separate state for such instances and set them to error eventually by timeout? but i\u0027m not sure if such case is worth introducing such changes.","commit_id":"05992960e6ea4add6e3c256978907bbcdecbd7dc"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0ac0435bd3134d0652882e5ae08e6a1cf6891934","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If the compute service is restarted while build requests are"},{"line_number":10,"context_line":"executing the instance_claim or waiting for the COMPUTE_RESOURCE_SEMAPHORE"},{"line_number":11,"context_line":"then those instances will be stuck forever in BUILDING state. If the instance"},{"line_number":12,"context_line":"already finished instance_claim then instance.host is set and when the"},{"line_number":13,"context_line":"compute restarts the instance is put to ERROR state."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"5faad753_51d88c79","line":11,"updated":"2019-09-16 13:44:22.000000000","message":"This is because instance.host isn\u0027t set so we log a warning here and return, correct?\n\nhttps://github.com/openstack/nova/blob/1a0d80dda224cf7220f1abf8993d6ed9c2c06dd9/nova/compute/manager.py#L829","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"62bdb703dc75c168223524bfc31f2becebfc0546","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If the compute service is restarted while build requests are"},{"line_number":10,"context_line":"executing the instance_claim or waiting for the COMPUTE_RESOURCE_SEMAPHORE"},{"line_number":11,"context_line":"then those instances will be stuck forever in BUILDING state. If the instance"},{"line_number":12,"context_line":"already finished instance_claim then instance.host is set and when the"},{"line_number":13,"context_line":"compute restarts the instance is put to ERROR state."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"3fa7e38b_aa8eebcd","line":11,"in_reply_to":"5faad753_1148d484","updated":"2019-09-17 08:41:47.000000000","message":"We don\u0027t even process such instances in init_host as the instance query in [1] is specific to this host but these instances are not assigned to this host yet, as that happens _after_ instance_claim. \n\n[1]https://github.com/openstack/nova/blob/1a0d80dda224cf7220f1abf8993d6ed9c2c06dd9/nova/compute/manager.py#L1257","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d88c98cfb244b4498b94f26cc148dd97100ded07","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If the compute service is restarted while build requests are"},{"line_number":10,"context_line":"executing the instance_claim or waiting for the COMPUTE_RESOURCE_SEMAPHORE"},{"line_number":11,"context_line":"then those instances will be stuck forever in BUILDING state. If the instance"},{"line_number":12,"context_line":"already finished instance_claim then instance.host is set and when the"},{"line_number":13,"context_line":"compute restarts the instance is put to ERROR state."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"5faad753_1148d484","line":11,"in_reply_to":"5faad753_51d88c79","updated":"2019-09-16 13:45:54.000000000","message":"Well we only get to that if instance.host \u003d\u003d self.host on the compute service.","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0ac0435bd3134d0652882e5ae08e6a1cf6891934","unresolved":false,"context_lines":[{"line_number":10,"context_line":"executing the instance_claim or waiting for the COMPUTE_RESOURCE_SEMAPHORE"},{"line_number":11,"context_line":"then those instances will be stuck forever in BUILDING state. If the instance"},{"line_number":12,"context_line":"already finished instance_claim then instance.host is set and when the"},{"line_number":13,"context_line":"compute restarts the instance is put to ERROR state."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This patch changes compute service startup to put instances into"},{"line_number":16,"context_line":"ERROR state if they a) are in the BUILDING state, and b) have"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"5faad753_11ce94b3","line":13,"updated":"2019-09-16 13:44:22.000000000","message":"And that\u0027s this correct?\n\nhttps://github.com/openstack/nova/blob/1a0d80dda224cf7220f1abf8993d6ed9c2c06dd9/nova/compute/manager.py#L869","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"62bdb703dc75c168223524bfc31f2becebfc0546","unresolved":false,"context_lines":[{"line_number":10,"context_line":"executing the instance_claim or waiting for the COMPUTE_RESOURCE_SEMAPHORE"},{"line_number":11,"context_line":"then those instances will be stuck forever in BUILDING state. If the instance"},{"line_number":12,"context_line":"already finished instance_claim then instance.host is set and when the"},{"line_number":13,"context_line":"compute restarts the instance is put to ERROR state."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This patch changes compute service startup to put instances into"},{"line_number":16,"context_line":"ERROR state if they a) are in the BUILDING state, and b) have"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"3fa7e38b_75fe8706","line":13,"in_reply_to":"5faad753_11ce94b3","updated":"2019-09-17 08:41:47.000000000","message":"yes, if the instance.host is set then we call init_instance and based on the instance.state we put the instance to ERROR.","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"}],"nova/compute/manager.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"58ffde38a15014c99fbaeb415650b60c93bca251","unresolved":false,"context_lines":[{"line_number":1251,"context_line":""},{"line_number":1252,"context_line":"    def _error_out_instances_whose_build_was_interrupted("},{"line_number":1253,"context_line":"            self, context, already_handled_instances):"},{"line_number":1254,"context_line":"        \"\"\"If there are instances in BUILD state that are not"},{"line_number":1255,"context_line":"        assigned to this host but has allocation in placement towards"},{"line_number":1256,"context_line":"        this compute that means the nova-compute service was"},{"line_number":1257,"context_line":"        restarted while those instances waited for the resource claim"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_d40f822b","line":1254,"range":{"start_line":1254,"start_character":37,"end_line":1254,"end_character":42},"updated":"2019-06-27 19:54:03.000000000","message":"BUILDING? (throughout)","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"faeb7eeb5d897f3200d6b47dcfab63df98a0df84","unresolved":false,"context_lines":[{"line_number":1251,"context_line":""},{"line_number":1252,"context_line":"    def _error_out_instances_whose_build_was_interrupted("},{"line_number":1253,"context_line":"            self, context, already_handled_instances):"},{"line_number":1254,"context_line":"        \"\"\"If there are instances in BUILD state that are not"},{"line_number":1255,"context_line":"        assigned to this host but has allocation in placement towards"},{"line_number":1256,"context_line":"        this compute that means the nova-compute service was"},{"line_number":1257,"context_line":"        restarted while those instances waited for the resource claim"}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_e5be37fe","line":1254,"range":{"start_line":1254,"start_character":37,"end_line":1254,"end_character":42},"in_reply_to":"9fb8cfa7_d40f822b","updated":"2019-07-05 13:08:54.000000000","message":"Done","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"58ffde38a15014c99fbaeb415650b60c93bca251","unresolved":false,"context_lines":[{"line_number":1252,"context_line":"    def _error_out_instances_whose_build_was_interrupted("},{"line_number":1253,"context_line":"            self, context, already_handled_instances):"},{"line_number":1254,"context_line":"        \"\"\"If there are instances in BUILD state that are not"},{"line_number":1255,"context_line":"        assigned to this host but has allocation in placement towards"},{"line_number":1256,"context_line":"        this compute that means the nova-compute service was"},{"line_number":1257,"context_line":"        restarted while those instances waited for the resource claim"},{"line_number":1258,"context_line":"        to finish and the _set_instance_host_and_node() to update the"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_140afa1e","line":1255,"range":{"start_line":1255,"start_character":34,"end_line":1255,"end_character":48},"updated":"2019-06-27 19:54:03.000000000","message":"have allocations","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"faeb7eeb5d897f3200d6b47dcfab63df98a0df84","unresolved":false,"context_lines":[{"line_number":1252,"context_line":"    def _error_out_instances_whose_build_was_interrupted("},{"line_number":1253,"context_line":"            self, context, already_handled_instances):"},{"line_number":1254,"context_line":"        \"\"\"If there are instances in BUILD state that are not"},{"line_number":1255,"context_line":"        assigned to this host but has allocation in placement towards"},{"line_number":1256,"context_line":"        this compute that means the nova-compute service was"},{"line_number":1257,"context_line":"        restarted while those instances waited for the resource claim"},{"line_number":1258,"context_line":"        to finish and the _set_instance_host_and_node() to update the"}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_65400709","line":1255,"range":{"start_line":1255,"start_character":34,"end_line":1255,"end_character":48},"in_reply_to":"9fb8cfa7_140afa1e","updated":"2019-07-05 13:08:54.000000000","message":"Done","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"58ffde38a15014c99fbaeb415650b60c93bca251","unresolved":false,"context_lines":[{"line_number":1266,"context_line":""},{"line_number":1267,"context_line":"        # Strategy:"},{"line_number":1268,"context_line":"        # 1) Get the allocations from placement for our compute node(s)"},{"line_number":1269,"context_line":"        # 2) Remove the already handled instances from the consumer list"},{"line_number":1270,"context_line":"        #    they are either already initialized or needs to be skipped."},{"line_number":1271,"context_line":"        # 3) Check which remaining consumer is an instance in BUILD state"},{"line_number":1272,"context_line":"        #    and push it to ERROR state."}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_342a9e7e","line":1269,"range":{"start_line":1269,"start_character":68,"end_line":1269,"end_character":72},"updated":"2019-06-27 19:54:03.000000000","message":";","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"faeb7eeb5d897f3200d6b47dcfab63df98a0df84","unresolved":false,"context_lines":[{"line_number":1266,"context_line":""},{"line_number":1267,"context_line":"        # Strategy:"},{"line_number":1268,"context_line":"        # 1) Get the allocations from placement for our compute node(s)"},{"line_number":1269,"context_line":"        # 2) Remove the already handled instances from the consumer list"},{"line_number":1270,"context_line":"        #    they are either already initialized or needs to be skipped."},{"line_number":1271,"context_line":"        # 3) Check which remaining consumer is an instance in BUILD state"},{"line_number":1272,"context_line":"        #    and push it to ERROR state."}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_8545031a","line":1269,"range":{"start_line":1269,"start_character":68,"end_line":1269,"end_character":72},"in_reply_to":"9fb8cfa7_342a9e7e","updated":"2019-07-05 13:08:54.000000000","message":"Done","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"58ffde38a15014c99fbaeb415650b60c93bca251","unresolved":false,"context_lines":[{"line_number":1267,"context_line":"        # Strategy:"},{"line_number":1268,"context_line":"        # 1) Get the allocations from placement for our compute node(s)"},{"line_number":1269,"context_line":"        # 2) Remove the already handled instances from the consumer list"},{"line_number":1270,"context_line":"        #    they are either already initialized or needs to be skipped."},{"line_number":1271,"context_line":"        # 3) Check which remaining consumer is an instance in BUILD state"},{"line_number":1272,"context_line":"        #    and push it to ERROR state."},{"line_number":1273,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_f41f2658","line":1270,"range":{"start_line":1270,"start_character":52,"end_line":1270,"end_character":57},"updated":"2019-06-27 19:54:03.000000000","message":"need","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"faeb7eeb5d897f3200d6b47dcfab63df98a0df84","unresolved":false,"context_lines":[{"line_number":1267,"context_line":"        # Strategy:"},{"line_number":1268,"context_line":"        # 1) Get the allocations from placement for our compute node(s)"},{"line_number":1269,"context_line":"        # 2) Remove the already handled instances from the consumer list"},{"line_number":1270,"context_line":"        #    they are either already initialized or needs to be skipped."},{"line_number":1271,"context_line":"        # 3) Check which remaining consumer is an instance in BUILD state"},{"line_number":1272,"context_line":"        #    and push it to ERROR state."},{"line_number":1273,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_45470b1f","line":1270,"range":{"start_line":1270,"start_character":52,"end_line":1270,"end_character":57},"in_reply_to":"9fb8cfa7_f41f2658","updated":"2019-07-05 13:08:54.000000000","message":"Done","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"58ffde38a15014c99fbaeb415650b60c93bca251","unresolved":false,"context_lines":[{"line_number":1286,"context_line":"                allocations \u003d f(context, cn_uuid).allocations"},{"line_number":1287,"context_line":"            except (exception.ResourceProviderAllocationRetrievalFailed,"},{"line_number":1288,"context_line":"                    keystone_exception.ClientException) as e:"},{"line_number":1289,"context_line":"                LOG.info(\"Compute node resource provider not found %s\", e)"},{"line_number":1290,"context_line":"                continue"},{"line_number":1291,"context_line":""},{"line_number":1292,"context_line":"            consumers \u003d set(allocations.keys())"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_b4420e3d","line":1289,"range":{"start_line":1289,"start_character":57,"end_line":1289,"end_character":66},"updated":"2019-06-27 19:54:03.000000000","message":"This is overly specific. Also should include the UUID. How about\n\n\"Couldn\u0027t retrieve compute node resource provider %s: %s\", cn_uuid, e","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"faeb7eeb5d897f3200d6b47dcfab63df98a0df84","unresolved":false,"context_lines":[{"line_number":1286,"context_line":"                allocations \u003d f(context, cn_uuid).allocations"},{"line_number":1287,"context_line":"            except (exception.ResourceProviderAllocationRetrievalFailed,"},{"line_number":1288,"context_line":"                    keystone_exception.ClientException) as e:"},{"line_number":1289,"context_line":"                LOG.info(\"Compute node resource provider not found %s\", e)"},{"line_number":1290,"context_line":"                continue"},{"line_number":1291,"context_line":""},{"line_number":1292,"context_line":"            consumers \u003d set(allocations.keys())"}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_c5645bbc","line":1289,"range":{"start_line":1289,"start_character":57,"end_line":1289,"end_character":66},"in_reply_to":"9fb8cfa7_b4420e3d","updated":"2019-07-05 13:08:54.000000000","message":"Done","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"58ffde38a15014c99fbaeb415650b60c93bca251","unresolved":false,"context_lines":[{"line_number":1289,"context_line":"                LOG.info(\"Compute node resource provider not found %s\", e)"},{"line_number":1290,"context_line":"                continue"},{"line_number":1291,"context_line":""},{"line_number":1292,"context_line":"            consumers \u003d set(allocations.keys())"},{"line_number":1293,"context_line":"            not_handled_consumers \u003d consumers - already_handled_instances"},{"line_number":1294,"context_line":""},{"line_number":1295,"context_line":"            for consumer in not_handled_consumers:"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_f46de6cb","line":1292,"range":{"start_line":1292,"start_character":39,"end_line":1292,"end_character":46},"updated":"2019-06-27 19:54:03.000000000","message":"redundant (py3) or worse (py2)","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"faeb7eeb5d897f3200d6b47dcfab63df98a0df84","unresolved":false,"context_lines":[{"line_number":1289,"context_line":"                LOG.info(\"Compute node resource provider not found %s\", e)"},{"line_number":1290,"context_line":"                continue"},{"line_number":1291,"context_line":""},{"line_number":1292,"context_line":"            consumers \u003d set(allocations.keys())"},{"line_number":1293,"context_line":"            not_handled_consumers \u003d consumers - already_handled_instances"},{"line_number":1294,"context_line":""},{"line_number":1295,"context_line":"            for consumer in not_handled_consumers:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_2573ef82","line":1292,"range":{"start_line":1292,"start_character":39,"end_line":1292,"end_character":46},"in_reply_to":"9fb8cfa7_f46de6cb","updated":"2019-07-05 13:08:54.000000000","message":"Done","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"58ffde38a15014c99fbaeb415650b60c93bca251","unresolved":false,"context_lines":[{"line_number":1294,"context_line":""},{"line_number":1295,"context_line":"            for consumer in not_handled_consumers:"},{"line_number":1296,"context_line":"                try:"},{"line_number":1297,"context_line":"                    instance \u003d objects.Instance.get_by_uuid(context, consumer)"},{"line_number":1298,"context_line":"                    if instance.vm_state \u003d\u003d vm_states.BUILDING:"},{"line_number":1299,"context_line":"                        LOG.debug(\"Instance spawn was interrupted, \""},{"line_number":1300,"context_line":"                                  \"setting to ERROR state\", instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_f4a2c6fb","line":1297,"range":{"start_line":1297,"start_character":48,"end_line":1297,"end_character":59},"updated":"2019-06-27 19:54:03.000000000","message":"is this more efficient with an expected_attrs\u003d[...]?","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"58ffde38a15014c99fbaeb415650b60c93bca251","unresolved":false,"context_lines":[{"line_number":1292,"context_line":"            consumers \u003d set(allocations.keys())"},{"line_number":1293,"context_line":"            not_handled_consumers \u003d consumers - already_handled_instances"},{"line_number":1294,"context_line":""},{"line_number":1295,"context_line":"            for consumer in not_handled_consumers:"},{"line_number":1296,"context_line":"                try:"},{"line_number":1297,"context_line":"                    instance \u003d objects.Instance.get_by_uuid(context, consumer)"},{"line_number":1298,"context_line":"                    if instance.vm_state \u003d\u003d vm_states.BUILDING:"},{"line_number":1299,"context_line":"                        LOG.debug(\"Instance spawn was interrupted, \""},{"line_number":1300,"context_line":"                                  \"setting to ERROR state\", instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_f4f086ff","line":1297,"range":{"start_line":1295,"start_character":12,"end_line":1297,"end_character":78},"updated":"2019-06-27 19:54:03.000000000","message":"ye gods, isn\u0027t this going to be dog slow for large+dense deployments (CERN)?","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"faeb7eeb5d897f3200d6b47dcfab63df98a0df84","unresolved":false,"context_lines":[{"line_number":1292,"context_line":"            consumers \u003d set(allocations.keys())"},{"line_number":1293,"context_line":"            not_handled_consumers \u003d consumers - already_handled_instances"},{"line_number":1294,"context_line":""},{"line_number":1295,"context_line":"            for consumer in not_handled_consumers:"},{"line_number":1296,"context_line":"                try:"},{"line_number":1297,"context_line":"                    instance \u003d objects.Instance.get_by_uuid(context, consumer)"},{"line_number":1298,"context_line":"                    if instance.vm_state \u003d\u003d vm_states.BUILDING:"},{"line_number":1299,"context_line":"                        LOG.debug(\"Instance spawn was interrupted, \""},{"line_number":1300,"context_line":"                                  \"setting to ERROR state\", instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_c509bbdd","line":1297,"range":{"start_line":1295,"start_character":12,"end_line":1297,"end_character":78},"in_reply_to":"9fb8cfa7_8d8fb873","updated":"2019-07-05 13:08:54.000000000","message":"Change this to a single DB query moving the state matching to DB as well.","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"faeb7eeb5d897f3200d6b47dcfab63df98a0df84","unresolved":false,"context_lines":[{"line_number":1294,"context_line":""},{"line_number":1295,"context_line":"            for consumer in not_handled_consumers:"},{"line_number":1296,"context_line":"                try:"},{"line_number":1297,"context_line":"                    instance \u003d objects.Instance.get_by_uuid(context, consumer)"},{"line_number":1298,"context_line":"                    if instance.vm_state \u003d\u003d vm_states.BUILDING:"},{"line_number":1299,"context_line":"                        LOG.debug(\"Instance spawn was interrupted, \""},{"line_number":1300,"context_line":"                                  \"setting to ERROR state\", instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_45706b73","line":1297,"range":{"start_line":1297,"start_character":48,"end_line":1297,"end_character":59},"in_reply_to":"9fb8cfa7_f4a2c6fb","updated":"2019-07-05 13:08:54.000000000","message":"Done","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"fc1d94912d04362279c6e723a24fbdf32766099b","unresolved":false,"context_lines":[{"line_number":1292,"context_line":"            consumers \u003d set(allocations.keys())"},{"line_number":1293,"context_line":"            not_handled_consumers \u003d consumers - already_handled_instances"},{"line_number":1294,"context_line":""},{"line_number":1295,"context_line":"            for consumer in not_handled_consumers:"},{"line_number":1296,"context_line":"                try:"},{"line_number":1297,"context_line":"                    instance \u003d objects.Instance.get_by_uuid(context, consumer)"},{"line_number":1298,"context_line":"                    if instance.vm_state \u003d\u003d vm_states.BUILDING:"},{"line_number":1299,"context_line":"                        LOG.debug(\"Instance spawn was interrupted, \""},{"line_number":1300,"context_line":"                                  \"setting to ERROR state\", instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_8d8fb873","line":1297,"range":{"start_line":1295,"start_character":12,"end_line":1297,"end_character":78},"in_reply_to":"9fb8cfa7_f4f086ff","updated":"2019-06-28 08:29:09.000000000","message":"not_handled_consumer expected to be a small list. I think I can load all the instances with a single db query that could help.","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d1cca006c5896ee2d1615b3d6a067fb37090d72a","unresolved":false,"context_lines":[{"line_number":1233,"context_line":"                    self._init_instance(context, instance)"},{"line_number":1234,"context_line":""},{"line_number":1235,"context_line":"            already_handled \u003d {instance.uuid for instance in instances}.union("},{"line_number":1236,"context_line":"                evacuated_instances.keys())"},{"line_number":1237,"context_line":"            self._error_out_instances_whose_build_was_interrupted("},{"line_number":1238,"context_line":"                context, already_handled)"},{"line_number":1239,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7faddb67_bd9681ef","line":1236,"range":{"start_line":1236,"start_character":35,"end_line":1236,"end_character":42},"updated":"2019-07-16 13:42:19.000000000","message":"redundant","commit_id":"05992960e6ea4add6e3c256978907bbcdecbd7dc"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c6ad71130011c4901ff542f1b49845554a9e2548","unresolved":false,"context_lines":[{"line_number":1233,"context_line":"                    self._init_instance(context, instance)"},{"line_number":1234,"context_line":""},{"line_number":1235,"context_line":"            already_handled \u003d {instance.uuid for instance in instances}.union("},{"line_number":1236,"context_line":"                evacuated_instances.keys())"},{"line_number":1237,"context_line":"            self._error_out_instances_whose_build_was_interrupted("},{"line_number":1238,"context_line":"                context, already_handled)"},{"line_number":1239,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7faddb67_6f7b087b","line":1236,"range":{"start_line":1236,"start_character":35,"end_line":1236,"end_character":42},"in_reply_to":"7faddb67_bd9681ef","updated":"2019-08-08 12:08:16.000000000","message":"Done","commit_id":"05992960e6ea4add6e3c256978907bbcdecbd7dc"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d1cca006c5896ee2d1615b3d6a067fb37090d72a","unresolved":false,"context_lines":[{"line_number":1277,"context_line":"                cn_uuid \u003d objects.ComputeNode.get_by_host_and_nodename("},{"line_number":1278,"context_line":"                    context, self.host, node_name).uuid"},{"line_number":1279,"context_line":"            except exception.ComputeHostNotFound:"},{"line_number":1280,"context_line":"                LOG.info("},{"line_number":1281,"context_line":"                    \"Compute node %s not found in the database\", node_name)"},{"line_number":1282,"context_line":"                continue"},{"line_number":1283,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7faddb67_8ff588ef","line":1280,"range":{"start_line":1280,"start_character":20,"end_line":1280,"end_character":24},"updated":"2019-07-16 13:42:19.000000000","message":"How does this happen? Seems like it should be a harsher reaction than LOG.info and continue?","commit_id":"05992960e6ea4add6e3c256978907bbcdecbd7dc"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ed4dc94201b7bbcb17e0ea0dbade5f706a3197a6","unresolved":false,"context_lines":[{"line_number":1277,"context_line":"                cn_uuid \u003d objects.ComputeNode.get_by_host_and_nodename("},{"line_number":1278,"context_line":"                    context, self.host, node_name).uuid"},{"line_number":1279,"context_line":"            except exception.ComputeHostNotFound:"},{"line_number":1280,"context_line":"                LOG.info("},{"line_number":1281,"context_line":"                    \"Compute node %s not found in the database\", node_name)"},{"line_number":1282,"context_line":"                continue"},{"line_number":1283,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7faddb67_8fb444d3","line":1280,"range":{"start_line":1280,"start_character":20,"end_line":1280,"end_character":24},"in_reply_to":"7faddb67_8ff588ef","updated":"2019-08-08 12:49:32.000000000","message":"Sure I can log a better warning.\n\nI don\u0027t think we can fail here as later on the the nodes newly discovered from the virt driver created in the db.","commit_id":"05992960e6ea4add6e3c256978907bbcdecbd7dc"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d1cca006c5896ee2d1615b3d6a067fb37090d72a","unresolved":false,"context_lines":[{"line_number":1286,"context_line":"                allocations \u003d f(context, cn_uuid).allocations"},{"line_number":1287,"context_line":"            except (exception.ResourceProviderAllocationRetrievalFailed,"},{"line_number":1288,"context_line":"                    keystone_exception.ClientException) as e:"},{"line_number":1289,"context_line":"                LOG.info(\"Couldn\u0027t retrieve compute node resource provider \""},{"line_number":1290,"context_line":"                         \"%s: %s\", cn_uuid, e)"},{"line_number":1291,"context_line":"                continue"},{"line_number":1292,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7faddb67_6ff04cfe","line":1289,"range":{"start_line":1289,"start_character":20,"end_line":1289,"end_character":24},"updated":"2019-07-16 13:42:19.000000000","message":"wonder if this should be a warning; and if the message should provide more context about the consequences (\"Couldn\u0027t retrieve... and therefore unable to error out any instances stuck in BUILDING state\" kind of thing)","commit_id":"05992960e6ea4add6e3c256978907bbcdecbd7dc"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ed4dc94201b7bbcb17e0ea0dbade5f706a3197a6","unresolved":false,"context_lines":[{"line_number":1286,"context_line":"                allocations \u003d f(context, cn_uuid).allocations"},{"line_number":1287,"context_line":"            except (exception.ResourceProviderAllocationRetrievalFailed,"},{"line_number":1288,"context_line":"                    keystone_exception.ClientException) as e:"},{"line_number":1289,"context_line":"                LOG.info(\"Couldn\u0027t retrieve compute node resource provider \""},{"line_number":1290,"context_line":"                         \"%s: %s\", cn_uuid, e)"},{"line_number":1291,"context_line":"                continue"},{"line_number":1292,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7faddb67_af60200f","line":1289,"range":{"start_line":1289,"start_character":20,"end_line":1289,"end_character":24},"in_reply_to":"7faddb67_6ff04cfe","updated":"2019-08-08 12:49:32.000000000","message":"Done","commit_id":"05992960e6ea4add6e3c256978907bbcdecbd7dc"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d1cca006c5896ee2d1615b3d6a067fb37090d72a","unresolved":false,"context_lines":[{"line_number":1290,"context_line":"                         \"%s: %s\", cn_uuid, e)"},{"line_number":1291,"context_line":"                continue"},{"line_number":1292,"context_line":""},{"line_number":1293,"context_line":"            consumers \u003d set(allocations)"},{"line_number":1294,"context_line":"            not_handled_consumers \u003d consumers - already_handled_instances"},{"line_number":1295,"context_line":""},{"line_number":1296,"context_line":"            if not not_handled_consumers:"}],"source_content_type":"text/x-python","patch_set":5,"id":"7faddb67_0fe1982a","line":1293,"range":{"start_line":1293,"start_character":12,"end_line":1293,"end_character":21},"updated":"2019-07-16 13:42:19.000000000","message":"nit: this variable could be eliminated","commit_id":"05992960e6ea4add6e3c256978907bbcdecbd7dc"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ed4dc94201b7bbcb17e0ea0dbade5f706a3197a6","unresolved":false,"context_lines":[{"line_number":1290,"context_line":"                         \"%s: %s\", cn_uuid, e)"},{"line_number":1291,"context_line":"                continue"},{"line_number":1292,"context_line":""},{"line_number":1293,"context_line":"            consumers \u003d set(allocations)"},{"line_number":1294,"context_line":"            not_handled_consumers \u003d consumers - already_handled_instances"},{"line_number":1295,"context_line":""},{"line_number":1296,"context_line":"            if not not_handled_consumers:"}],"source_content_type":"text/x-python","patch_set":5,"id":"7faddb67_cf4ebc95","line":1293,"range":{"start_line":1293,"start_character":12,"end_line":1293,"end_character":21},"in_reply_to":"7faddb67_0fe1982a","updated":"2019-08-08 12:49:32.000000000","message":"Done","commit_id":"05992960e6ea4add6e3c256978907bbcdecbd7dc"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d1cca006c5896ee2d1615b3d6a067fb37090d72a","unresolved":false,"context_lines":[{"line_number":1298,"context_line":""},{"line_number":1299,"context_line":"            filters \u003d {"},{"line_number":1300,"context_line":"                \u0027vm_state\u0027: vm_states.BUILDING,"},{"line_number":1301,"context_line":"                \u0027uuid\u0027: not_handled_consumers"},{"line_number":1302,"context_line":"            }"},{"line_number":1303,"context_line":""},{"line_number":1304,"context_line":"            instances \u003d objects.InstanceList.get_by_filters("}],"source_content_type":"text/x-python","patch_set":5,"id":"7faddb67_2ffa54bc","line":1301,"range":{"start_line":1301,"start_character":16,"end_line":1301,"end_character":45},"updated":"2019-07-16 13:42:19.000000000","message":"Okay, this dtrt with a set(): https://opendev.org/openstack/nova/src/branch/master/nova/db/sqlalchemy/api.py#L2458-L2463","commit_id":"05992960e6ea4add6e3c256978907bbcdecbd7dc"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ed4dc94201b7bbcb17e0ea0dbade5f706a3197a6","unresolved":false,"context_lines":[{"line_number":1298,"context_line":""},{"line_number":1299,"context_line":"            filters \u003d {"},{"line_number":1300,"context_line":"                \u0027vm_state\u0027: vm_states.BUILDING,"},{"line_number":1301,"context_line":"                \u0027uuid\u0027: not_handled_consumers"},{"line_number":1302,"context_line":"            }"},{"line_number":1303,"context_line":""},{"line_number":1304,"context_line":"            instances \u003d objects.InstanceList.get_by_filters("}],"source_content_type":"text/x-python","patch_set":5,"id":"7faddb67_6f43086e","line":1301,"range":{"start_line":1301,"start_character":16,"end_line":1301,"end_character":45},"in_reply_to":"7faddb67_2ffa54bc","updated":"2019-08-08 12:49:32.000000000","message":"Done","commit_id":"05992960e6ea4add6e3c256978907bbcdecbd7dc"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0ac0435bd3134d0652882e5ae08e6a1cf6891934","unresolved":false,"context_lines":[{"line_number":832,"context_line":"        # is a possibility, don\u0027t touch the instance in any way, but"},{"line_number":833,"context_line":"        # log the concern. This will help avoid potential issues on"},{"line_number":834,"context_line":"        # startup due to misconfiguration."},{"line_number":835,"context_line":"        if instance.host !\u003d self.host:"},{"line_number":836,"context_line":"            LOG.warning(\u0027Instance %(uuid)s appears to not be owned \u0027"},{"line_number":837,"context_line":"                        \u0027by this host, but by %(host)s. Startup \u0027"},{"line_number":838,"context_line":"                        \u0027processing is being skipped.\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"5faad753_51c2cc5a","line":835,"updated":"2019-09-16 13:44:22.000000000","message":"Why not handle your new check in here? I realize we wouldn\u0027t get in here for evacuated instances with the logic below, but do we care about evacuated instances in this case?\n\nOh or is because we wouldn\u0027t get here since init_host only gets instances with the host set? And in our case the host isn\u0027t set on the instance since the compute crashed before instance_claim could do that.","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0ac0435bd3134d0652882e5ae08e6a1cf6891934","unresolved":false,"context_lines":[{"line_number":1269,"context_line":"        try:"},{"line_number":1270,"context_line":"            # checking that instance was not already evacuated to other host"},{"line_number":1271,"context_line":"            evacuated_instances \u003d self._destroy_evacuated_instances("},{"line_number":1272,"context_line":"                context) or {}"},{"line_number":1273,"context_line":""},{"line_number":1274,"context_line":"            # Initialise instances on the host that are not evacuating"},{"line_number":1275,"context_line":"            for instance in instances:"}],"source_content_type":"text/x-python","patch_set":7,"id":"5faad753_f15898fa","line":1272,"range":{"start_line":1272,"start_character":25,"end_line":1272,"end_character":30},"updated":"2019-09-16 13:44:22.000000000","message":"nit: I think it would be cleaner to move this to _destroy_evacuated_instances:\n\nhttps://github.com/openstack/nova/blob/1a0d80dda224cf7220f1abf8993d6ed9c2c06dd9/nova/compute/manager.py#L689","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a4a9d50b7b0bfff0e1a22df26b1ab6523ebe4938","unresolved":false,"context_lines":[{"line_number":1269,"context_line":"        try:"},{"line_number":1270,"context_line":"            # checking that instance was not already evacuated to other host"},{"line_number":1271,"context_line":"            evacuated_instances \u003d self._destroy_evacuated_instances("},{"line_number":1272,"context_line":"                context) or {}"},{"line_number":1273,"context_line":""},{"line_number":1274,"context_line":"            # Initialise instances on the host that are not evacuating"},{"line_number":1275,"context_line":"            for instance in instances:"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_56e9127e","line":1272,"range":{"start_line":1272,"start_character":25,"end_line":1272,"end_character":30},"in_reply_to":"5faad753_f15898fa","updated":"2019-09-17 12:01:23.000000000","message":"Done","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0ac0435bd3134d0652882e5ae08e6a1cf6891934","unresolved":false,"context_lines":[{"line_number":1273,"context_line":""},{"line_number":1274,"context_line":"            # Initialise instances on the host that are not evacuating"},{"line_number":1275,"context_line":"            for instance in instances:"},{"line_number":1276,"context_line":"                if instance.uuid not in evacuated_instances:"},{"line_number":1277,"context_line":"                    self._init_instance(context, instance)"},{"line_number":1278,"context_line":""},{"line_number":1279,"context_line":"            already_handled \u003d {instance.uuid for instance in instances}.union("}],"source_content_type":"text/x-python","patch_set":7,"id":"5faad753_d171dc77","line":1276,"updated":"2019-09-16 13:44:22.000000000","message":"OK we need to make sure evacuated_instances is not None otherwise we\u0027d get a TypeError on this with the new code.","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a4a9d50b7b0bfff0e1a22df26b1ab6523ebe4938","unresolved":false,"context_lines":[{"line_number":1273,"context_line":""},{"line_number":1274,"context_line":"            # Initialise instances on the host that are not evacuating"},{"line_number":1275,"context_line":"            for instance in instances:"},{"line_number":1276,"context_line":"                if instance.uuid not in evacuated_instances:"},{"line_number":1277,"context_line":"                    self._init_instance(context, instance)"},{"line_number":1278,"context_line":""},{"line_number":1279,"context_line":"            already_handled \u003d {instance.uuid for instance in instances}.union("}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_16039a44","line":1276,"in_reply_to":"5faad753_d171dc77","updated":"2019-09-17 12:01:23.000000000","message":"Done","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0ac0435bd3134d0652882e5ae08e6a1cf6891934","unresolved":false,"context_lines":[{"line_number":1276,"context_line":"                if instance.uuid not in evacuated_instances:"},{"line_number":1277,"context_line":"                    self._init_instance(context, instance)"},{"line_number":1278,"context_line":""},{"line_number":1279,"context_line":"            already_handled \u003d {instance.uuid for instance in instances}.union("},{"line_number":1280,"context_line":"                evacuated_instances)"},{"line_number":1281,"context_line":"            self._error_out_instances_whose_build_was_interrupted("},{"line_number":1282,"context_line":"                context, already_handled)"}],"source_content_type":"text/x-python","patch_set":7,"id":"5faad753_313150a4","line":1279,"updated":"2019-09-16 13:44:22.000000000","message":"A comment here would be useful. I guess you\u0027re building a set of instance uuids for all instances (on this host) that were not evacuating from this host and have been processed in _init_instance above and also the list of evacuated instance uuids.","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a4a9d50b7b0bfff0e1a22df26b1ab6523ebe4938","unresolved":false,"context_lines":[{"line_number":1276,"context_line":"                if instance.uuid not in evacuated_instances:"},{"line_number":1277,"context_line":"                    self._init_instance(context, instance)"},{"line_number":1278,"context_line":""},{"line_number":1279,"context_line":"            already_handled \u003d {instance.uuid for instance in instances}.union("},{"line_number":1280,"context_line":"                evacuated_instances)"},{"line_number":1281,"context_line":"            self._error_out_instances_whose_build_was_interrupted("},{"line_number":1282,"context_line":"                context, already_handled)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_96bd4a6a","line":1279,"in_reply_to":"5faad753_313150a4","updated":"2019-09-17 12:01:23.000000000","message":"Done","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0ac0435bd3134d0652882e5ae08e6a1cf6891934","unresolved":false,"context_lines":[{"line_number":1293,"context_line":"                # _sync_scheduler_instance_info periodic task will."},{"line_number":1294,"context_line":"                self._update_scheduler_instance_info(context, instances)"},{"line_number":1295,"context_line":""},{"line_number":1296,"context_line":"    def _error_out_instances_whose_build_was_interrupted("},{"line_number":1297,"context_line":"            self, context, already_handled_instances):"},{"line_number":1298,"context_line":"        \"\"\"If there are instances in BUILDING state that are not"},{"line_number":1299,"context_line":"        assigned to this host but have allocations in placement towards"}],"source_content_type":"text/x-python","patch_set":7,"id":"5faad753_51908c4a","line":1296,"range":{"start_line":1296,"start_character":8,"end_line":1296,"end_character":56},"updated":"2019-09-16 13:44:22.000000000","message":"This seems tightly coupled to how _init_instance works and that\u0027s why I\u0027m wondering why we don\u0027t just do this check in that method? Is it for efficiency reasons since we pass a list of instance uuids to this method but _init_instance is once per instance, and many might be on the same compute node?\n\nIf we keep the methods decoupled like this, we should probably have a comment in the condition in _init_instance where we return saying we\u0027ll process the instance in this method.\n\n(later)\n\nI think I realize now - _init_instance won\u0027t be called b/c init_host filters out instances whose instance.host doesn\u0027t match self.host, which would be the case if the service crashed before instance_claim set the field.","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a4a9d50b7b0bfff0e1a22df26b1ab6523ebe4938","unresolved":false,"context_lines":[{"line_number":1293,"context_line":"                # _sync_scheduler_instance_info periodic task will."},{"line_number":1294,"context_line":"                self._update_scheduler_instance_info(context, instances)"},{"line_number":1295,"context_line":""},{"line_number":1296,"context_line":"    def _error_out_instances_whose_build_was_interrupted("},{"line_number":1297,"context_line":"            self, context, already_handled_instances):"},{"line_number":1298,"context_line":"        \"\"\"If there are instances in BUILDING state that are not"},{"line_number":1299,"context_line":"        assigned to this host but have allocations in placement towards"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_d6aae217","line":1296,"range":{"start_line":1296,"start_character":8,"end_line":1296,"end_character":56},"in_reply_to":"5faad753_51908c4a","updated":"2019-09-17 12:01:23.000000000","message":"your later observation is correct.","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0ac0435bd3134d0652882e5ae08e6a1cf6891934","unresolved":false,"context_lines":[{"line_number":1295,"context_line":""},{"line_number":1296,"context_line":"    def _error_out_instances_whose_build_was_interrupted("},{"line_number":1297,"context_line":"            self, context, already_handled_instances):"},{"line_number":1298,"context_line":"        \"\"\"If there are instances in BUILDING state that are not"},{"line_number":1299,"context_line":"        assigned to this host but have allocations in placement towards"},{"line_number":1300,"context_line":"        this compute that means the nova-compute service was"},{"line_number":1301,"context_line":"        restarted while those instances waited for the resource claim"}],"source_content_type":"text/x-python","patch_set":7,"id":"5faad753_11ad349a","line":1298,"updated":"2019-09-16 13:44:22.000000000","message":"Note that we could technically have the same issue for instances with vm_state UNSHELVING:\n\nhttps://github.com/openstack/nova/blob/1a0d80dda224cf7220f1abf8993d6ed9c2c06dd9/nova/compute/manager.py#L5480\n\nThough I\u0027d say let\u0027s deal with that separately (if we care to) since we\u0027d want a functional test for that case as well.","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0dd876cdd8a329ce238bf0195b98bed4f53ff0e9","unresolved":false,"context_lines":[{"line_number":1295,"context_line":""},{"line_number":1296,"context_line":"    def _error_out_instances_whose_build_was_interrupted("},{"line_number":1297,"context_line":"            self, context, already_handled_instances):"},{"line_number":1298,"context_line":"        \"\"\"If there are instances in BUILDING state that are not"},{"line_number":1299,"context_line":"        assigned to this host but have allocations in placement towards"},{"line_number":1300,"context_line":"        this compute that means the nova-compute service was"},{"line_number":1301,"context_line":"        restarted while those instances waited for the resource claim"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_6a04617c","line":1298,"in_reply_to":"3fa7e38b_165f1a42","updated":"2019-09-17 13:36:02.000000000","message":"OK we could report a separate bug for the unshelve case and mark it low priority.","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a4a9d50b7b0bfff0e1a22df26b1ab6523ebe4938","unresolved":false,"context_lines":[{"line_number":1295,"context_line":""},{"line_number":1296,"context_line":"    def _error_out_instances_whose_build_was_interrupted("},{"line_number":1297,"context_line":"            self, context, already_handled_instances):"},{"line_number":1298,"context_line":"        \"\"\"If there are instances in BUILDING state that are not"},{"line_number":1299,"context_line":"        assigned to this host but have allocations in placement towards"},{"line_number":1300,"context_line":"        this compute that means the nova-compute service was"},{"line_number":1301,"context_line":"        restarted while those instances waited for the resource claim"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_165f1a42","line":1298,"in_reply_to":"5faad753_11ad349a","updated":"2019-09-17 12:01:23.000000000","message":"Agree. I do this as I have a bug report from one of our customers. They never tried shelving instances so they never tried unshelving instances in parallel. But they do a lot of parallel boots.","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0ac0435bd3134d0652882e5ae08e6a1cf6891934","unresolved":false,"context_lines":[{"line_number":1333,"context_line":"            except (exception.ResourceProviderAllocationRetrievalFailed,"},{"line_number":1334,"context_line":"                    keystone_exception.ClientException) as e:"},{"line_number":1335,"context_line":"                LOG.error("},{"line_number":1336,"context_line":"                    \"Couldn\u0027t retrieve compute node resource provider %s: %s \""},{"line_number":1337,"context_line":"                    \"and therefore unable to error out any instances stuck in \""},{"line_number":1338,"context_line":"                    \"BUILDING state.\", cn_uuid, e)"},{"line_number":1339,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":7,"id":"5faad753_31e070cd","line":1336,"range":{"start_line":1336,"start_character":21,"end_line":1336,"end_character":29},"updated":"2019-09-16 13:44:22.000000000","message":"Avoid contractions in user-facing and log messages.","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0ac0435bd3134d0652882e5ae08e6a1cf6891934","unresolved":false,"context_lines":[{"line_number":1333,"context_line":"            except (exception.ResourceProviderAllocationRetrievalFailed,"},{"line_number":1334,"context_line":"                    keystone_exception.ClientException) as e:"},{"line_number":1335,"context_line":"                LOG.error("},{"line_number":1336,"context_line":"                    \"Couldn\u0027t retrieve compute node resource provider %s: %s \""},{"line_number":1337,"context_line":"                    \"and therefore unable to error out any instances stuck in \""},{"line_number":1338,"context_line":"                    \"BUILDING state.\", cn_uuid, e)"},{"line_number":1339,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":7,"id":"5faad753_f1fe5869","line":1336,"range":{"start_line":1336,"start_character":74,"end_line":1336,"end_character":76},"updated":"2019-09-16 13:44:22.000000000","message":"nit: I\u0027d avoid putting an error in the middle of the sentence since it\u0027s going to look weird when it\u0027s all logged. Move the error to the end somehow, e.g.:\n\n\"Could not retrieve compute node resource provider %s and therefore unable to error out any instances stuck in BUILDING state. Error: %s\"","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a4a9d50b7b0bfff0e1a22df26b1ab6523ebe4938","unresolved":false,"context_lines":[{"line_number":1333,"context_line":"            except (exception.ResourceProviderAllocationRetrievalFailed,"},{"line_number":1334,"context_line":"                    keystone_exception.ClientException) as e:"},{"line_number":1335,"context_line":"                LOG.error("},{"line_number":1336,"context_line":"                    \"Couldn\u0027t retrieve compute node resource provider %s: %s \""},{"line_number":1337,"context_line":"                    \"and therefore unable to error out any instances stuck in \""},{"line_number":1338,"context_line":"                    \"BUILDING state.\", cn_uuid, e)"},{"line_number":1339,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_f6035e0e","line":1336,"range":{"start_line":1336,"start_character":74,"end_line":1336,"end_character":76},"in_reply_to":"5faad753_f1fe5869","updated":"2019-09-17 12:01:23.000000000","message":"Done","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0ac0435bd3134d0652882e5ae08e6a1cf6891934","unresolved":false,"context_lines":[{"line_number":1338,"context_line":"                    \"BUILDING state.\", cn_uuid, e)"},{"line_number":1339,"context_line":"                continue"},{"line_number":1340,"context_line":""},{"line_number":1341,"context_line":"            not_handled_consumers \u003d (set(allocations) -"},{"line_number":1342,"context_line":"                                     already_handled_instances)"},{"line_number":1343,"context_line":""},{"line_number":1344,"context_line":"            if not not_handled_consumers:"},{"line_number":1345,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":7,"id":"5faad753_714ee8c1","line":1342,"range":{"start_line":1341,"start_character":36,"end_line":1342,"end_character":63},"updated":"2019-09-16 13:44:22.000000000","message":"OK so if we have an instance that is stuck in BUILDING without a host and has allocations on this provider, and is not in already_handled_allocations, then we process it. And in the case we care about for this bug, it won\u0027t be in already_handled_instances because that set only contains instance uuids for instances whose host is set to self.host.","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a4a9d50b7b0bfff0e1a22df26b1ab6523ebe4938","unresolved":false,"context_lines":[{"line_number":1338,"context_line":"                    \"BUILDING state.\", cn_uuid, e)"},{"line_number":1339,"context_line":"                continue"},{"line_number":1340,"context_line":""},{"line_number":1341,"context_line":"            not_handled_consumers \u003d (set(allocations) -"},{"line_number":1342,"context_line":"                                     already_handled_instances)"},{"line_number":1343,"context_line":""},{"line_number":1344,"context_line":"            if not not_handled_consumers:"},{"line_number":1345,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_5921459f","line":1342,"range":{"start_line":1341,"start_character":36,"end_line":1342,"end_character":63},"in_reply_to":"5faad753_714ee8c1","updated":"2019-09-17 12:01:23.000000000","message":"yepp","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0ac0435bd3134d0652882e5ae08e6a1cf6891934","unresolved":false,"context_lines":[{"line_number":1349,"context_line":"                \u0027uuid\u0027: not_handled_consumers"},{"line_number":1350,"context_line":"            }"},{"line_number":1351,"context_line":""},{"line_number":1352,"context_line":"            instances \u003d objects.InstanceList.get_by_filters("},{"line_number":1353,"context_line":"                context, filters, expected_attrs\u003d[])"},{"line_number":1354,"context_line":""},{"line_number":1355,"context_line":"            for instance in instances:"},{"line_number":1356,"context_line":"                LOG.debug(\"Instance spawn was interrupted, \""}],"source_content_type":"text/x-python","patch_set":7,"id":"5faad753_b1dd40e1","line":1353,"range":{"start_line":1352,"start_character":12,"end_line":1353,"end_character":52},"updated":"2019-09-16 13:44:22.000000000","message":"OK and this will filter out potential migrations, i.e. if we have consumers in placement that are migrations rather than instances.","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a4a9d50b7b0bfff0e1a22df26b1ab6523ebe4938","unresolved":false,"context_lines":[{"line_number":1349,"context_line":"                \u0027uuid\u0027: not_handled_consumers"},{"line_number":1350,"context_line":"            }"},{"line_number":1351,"context_line":""},{"line_number":1352,"context_line":"            instances \u003d objects.InstanceList.get_by_filters("},{"line_number":1353,"context_line":"                context, filters, expected_attrs\u003d[])"},{"line_number":1354,"context_line":""},{"line_number":1355,"context_line":"            for instance in instances:"},{"line_number":1356,"context_line":"                LOG.debug(\"Instance spawn was interrupted, \""}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_792681ba","line":1353,"range":{"start_line":1352,"start_character":12,"end_line":1353,"end_character":52},"in_reply_to":"5faad753_b1dd40e1","updated":"2019-09-17 12:01:23.000000000","message":"yepp","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0ac0435bd3134d0652882e5ae08e6a1cf6891934","unresolved":false,"context_lines":[{"line_number":1353,"context_line":"                context, filters, expected_attrs\u003d[])"},{"line_number":1354,"context_line":""},{"line_number":1355,"context_line":"            for instance in instances:"},{"line_number":1356,"context_line":"                LOG.debug(\"Instance spawn was interrupted, \""},{"line_number":1357,"context_line":"                          \"setting to ERROR state\", instance\u003dinstance)"},{"line_number":1358,"context_line":"                instance.task_state \u003d None"},{"line_number":1359,"context_line":"                instance.vm_state \u003d vm_states.ERROR"},{"line_number":1360,"context_line":"                instance.save()"},{"line_number":1361,"context_line":""},{"line_number":1362,"context_line":"    def cleanup_host(self):"},{"line_number":1363,"context_line":"        self.driver.register_event_listener(None)"}],"source_content_type":"text/x-python","patch_set":7,"id":"5faad753_51f64c65","line":1360,"range":{"start_line":1356,"start_character":16,"end_line":1360,"end_character":31},"updated":"2019-09-16 13:44:22.000000000","message":"This is basically:\n\nhttps://github.com/openstack/nova/blob/1a0d80dda224cf7220f1abf8993d6ed9c2c06dd9/nova/compute/manager.py#L862-L870\n\nWhat do you think about pulling that out into a common block to re-use? Same comment, log message, etc. You could call it something like _error_instance_failed_spawn_host_restart or something.","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5d4cc5b343f598e1e8c3804bf7d42282294da14e","unresolved":false,"context_lines":[{"line_number":1353,"context_line":"                context, filters, expected_attrs\u003d[])"},{"line_number":1354,"context_line":""},{"line_number":1355,"context_line":"            for instance in instances:"},{"line_number":1356,"context_line":"                LOG.debug(\"Instance spawn was interrupted, \""},{"line_number":1357,"context_line":"                          \"setting to ERROR state\", instance\u003dinstance)"},{"line_number":1358,"context_line":"                instance.task_state \u003d None"},{"line_number":1359,"context_line":"                instance.vm_state \u003d vm_states.ERROR"},{"line_number":1360,"context_line":"                instance.save()"},{"line_number":1361,"context_line":""},{"line_number":1362,"context_line":"    def cleanup_host(self):"},{"line_number":1363,"context_line":"        self.driver.register_event_listener(None)"}],"source_content_type":"text/x-python","patch_set":7,"id":"5faad753_d1223cb9","line":1360,"range":{"start_line":1356,"start_character":16,"end_line":1360,"end_character":31},"in_reply_to":"5faad753_51f64c65","updated":"2019-09-16 13:48:31.000000000","message":"s/block/method/.","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a4a9d50b7b0bfff0e1a22df26b1ab6523ebe4938","unresolved":false,"context_lines":[{"line_number":1353,"context_line":"                context, filters, expected_attrs\u003d[])"},{"line_number":1354,"context_line":""},{"line_number":1355,"context_line":"            for instance in instances:"},{"line_number":1356,"context_line":"                LOG.debug(\"Instance spawn was interrupted, \""},{"line_number":1357,"context_line":"                          \"setting to ERROR state\", instance\u003dinstance)"},{"line_number":1358,"context_line":"                instance.task_state \u003d None"},{"line_number":1359,"context_line":"                instance.vm_state \u003d vm_states.ERROR"},{"line_number":1360,"context_line":"                instance.save()"},{"line_number":1361,"context_line":""},{"line_number":1362,"context_line":"    def cleanup_host(self):"},{"line_number":1363,"context_line":"        self.driver.register_event_listener(None)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_b97ab985","line":1360,"range":{"start_line":1356,"start_character":16,"end_line":1360,"end_character":31},"in_reply_to":"5faad753_d1223cb9","updated":"2019-09-17 12:01:23.000000000","message":"Hm. I think it would be better to make this LOG specific so if the admin needs to troubleshoot why an instance ended up in ERROR state it will be clear that is was a build that was interrupted before the instance claim. I can pull out the rest of the block.\n\nDone.","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0dd876cdd8a329ce238bf0195b98bed4f53ff0e9","unresolved":false,"context_lines":[{"line_number":669,"context_line":""},{"line_number":670,"context_line":"        :param context: The request context"},{"line_number":671,"context_line":"        :return: A dict keyed by instance uuid mapped to Migration objects"},{"line_number":672,"context_line":"            for instances that was migrated away from this host"},{"line_number":673,"context_line":"        \"\"\""},{"line_number":674,"context_line":"        filters \u003d {"},{"line_number":675,"context_line":"            \u0027source_compute\u0027: self.host,"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_6a88e11e","line":672,"range":{"start_line":672,"start_character":31,"end_line":672,"end_character":34},"updated":"2019-09-17 13:36:02.000000000","message":"were","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"18aa5340d127126e09d82ab4d7e041da706648fa","unresolved":false,"context_lines":[{"line_number":669,"context_line":""},{"line_number":670,"context_line":"        :param context: The request context"},{"line_number":671,"context_line":"        :return: A dict keyed by instance uuid mapped to Migration objects"},{"line_number":672,"context_line":"            for instances that was migrated away from this host"},{"line_number":673,"context_line":"        \"\"\""},{"line_number":674,"context_line":"        filters \u003d {"},{"line_number":675,"context_line":"            \u0027source_compute\u0027: self.host,"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_ea55b11e","line":672,"range":{"start_line":672,"start_character":31,"end_line":672,"end_character":34},"in_reply_to":"3fa7e38b_6a88e11e","updated":"2019-09-17 14:17:50.000000000","message":"Done","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8ca50aad0a8f09bba64699b5e744dfded810a6c1","unresolved":false,"context_lines":[{"line_number":690,"context_line":"            evacuations \u003d objects.MigrationList.get_by_filters(context,"},{"line_number":691,"context_line":"                                                               filters)"},{"line_number":692,"context_line":"        if not evacuations:"},{"line_number":693,"context_line":"            return {}"},{"line_number":694,"context_line":"        evacuations \u003d {mig.instance_uuid: mig for mig in evacuations}"},{"line_number":695,"context_line":""},{"line_number":696,"context_line":"        # TODO(mriedem): We could optimize by pre-loading the joined fields"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_ea1db1bd","line":693,"updated":"2019-09-17 13:44:56.000000000","message":"yeah, good point, easier to read the conditional below (even if that sounds a bit unnecessary in the change itself but I\u0027m cool with)","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0dd876cdd8a329ce238bf0195b98bed4f53ff0e9","unresolved":false,"context_lines":[{"line_number":1075,"context_line":"                LOG.debug(\u0027Hypervisor driver does not support \u0027"},{"line_number":1076,"context_line":"                          \u0027firewall rules\u0027, instance\u003dinstance)"},{"line_number":1077,"context_line":""},{"line_number":1078,"context_line":"    def error_instance_failed_to_spawn(self, instance):"},{"line_number":1079,"context_line":"        instance.task_state \u003d None"},{"line_number":1080,"context_line":"        instance.vm_state \u003d vm_states.ERROR"},{"line_number":1081,"context_line":"        instance.save()"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_8ab75dd9","line":1078,"updated":"2019-09-17 13:36:02.000000000","message":"It occurs to me you can just use _set_instance_obj_error_state rather than add a new method.","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"18aa5340d127126e09d82ab4d7e041da706648fa","unresolved":false,"context_lines":[{"line_number":1075,"context_line":"                LOG.debug(\u0027Hypervisor driver does not support \u0027"},{"line_number":1076,"context_line":"                          \u0027firewall rules\u0027, instance\u003dinstance)"},{"line_number":1077,"context_line":""},{"line_number":1078,"context_line":"    def error_instance_failed_to_spawn(self, instance):"},{"line_number":1079,"context_line":"        instance.task_state \u003d None"},{"line_number":1080,"context_line":"        instance.vm_state \u003d vm_states.ERROR"},{"line_number":1081,"context_line":"        instance.save()"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_6a18e180","line":1078,"in_reply_to":"3fa7e38b_8ab75dd9","updated":"2019-09-17 14:17:50.000000000","message":"Done","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8ca50aad0a8f09bba64699b5e744dfded810a6c1","unresolved":false,"context_lines":[{"line_number":1270,"context_line":"        try:"},{"line_number":1271,"context_line":"            # checking that instance was not already evacuated to other host"},{"line_number":1272,"context_line":"            evacuated_instances \u003d self._destroy_evacuated_instances("},{"line_number":1273,"context_line":"                context)"},{"line_number":1274,"context_line":""},{"line_number":1275,"context_line":"            # Initialise instances on the host that are not evacuating"},{"line_number":1276,"context_line":"            for instance in instances:"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_6a39c13f","line":1273,"updated":"2019-09-17 13:44:56.000000000","message":"sounds unnecessary but okay","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"18aa5340d127126e09d82ab4d7e041da706648fa","unresolved":false,"context_lines":[{"line_number":1270,"context_line":"        try:"},{"line_number":1271,"context_line":"            # checking that instance was not already evacuated to other host"},{"line_number":1272,"context_line":"            evacuated_instances \u003d self._destroy_evacuated_instances("},{"line_number":1273,"context_line":"                context)"},{"line_number":1274,"context_line":""},{"line_number":1275,"context_line":"            # Initialise instances on the host that are not evacuating"},{"line_number":1276,"context_line":"            for instance in instances:"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_a57a8a85","line":1273,"in_reply_to":"3fa7e38b_6a39c13f","updated":"2019-09-17 14:17:50.000000000","message":"Done","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0dd876cdd8a329ce238bf0195b98bed4f53ff0e9","unresolved":false,"context_lines":[{"line_number":1277,"context_line":"                if instance.uuid not in evacuated_instances:"},{"line_number":1278,"context_line":"                    self._init_instance(context, instance)"},{"line_number":1279,"context_line":""},{"line_number":1280,"context_line":"            # NOTE(gibi): collection all the instance uuids that is some way"},{"line_number":1281,"context_line":"            # already handled above. Either by init_instance or by"},{"line_number":1282,"context_line":"            # _destroy_evacuated_instances. This way we can limit the scope of"},{"line_number":1283,"context_line":"            # the _error_out_instances_whose_build_was_interrupted call to look"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_6ab6a1dc","line":1280,"range":{"start_line":1280,"start_character":26,"end_line":1280,"end_character":36},"updated":"2019-09-17 13:36:02.000000000","message":"collect","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0dd876cdd8a329ce238bf0195b98bed4f53ff0e9","unresolved":false,"context_lines":[{"line_number":1277,"context_line":"                if instance.uuid not in evacuated_instances:"},{"line_number":1278,"context_line":"                    self._init_instance(context, instance)"},{"line_number":1279,"context_line":""},{"line_number":1280,"context_line":"            # NOTE(gibi): collection all the instance uuids that is some way"},{"line_number":1281,"context_line":"            # already handled above. Either by init_instance or by"},{"line_number":1282,"context_line":"            # _destroy_evacuated_instances. This way we can limit the scope of"},{"line_number":1283,"context_line":"            # the _error_out_instances_whose_build_was_interrupted call to look"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_0acb6d53","line":1280,"range":{"start_line":1280,"start_character":65,"end_line":1280,"end_character":67},"updated":"2019-09-17 13:36:02.000000000","message":"in","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"18aa5340d127126e09d82ab4d7e041da706648fa","unresolved":false,"context_lines":[{"line_number":1277,"context_line":"                if instance.uuid not in evacuated_instances:"},{"line_number":1278,"context_line":"                    self._init_instance(context, instance)"},{"line_number":1279,"context_line":""},{"line_number":1280,"context_line":"            # NOTE(gibi): collection all the instance uuids that is some way"},{"line_number":1281,"context_line":"            # already handled above. Either by init_instance or by"},{"line_number":1282,"context_line":"            # _destroy_evacuated_instances. This way we can limit the scope of"},{"line_number":1283,"context_line":"            # the _error_out_instances_whose_build_was_interrupted call to look"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_ea03710e","line":1280,"range":{"start_line":1280,"start_character":65,"end_line":1280,"end_character":67},"in_reply_to":"3fa7e38b_0acb6d53","updated":"2019-09-17 14:17:50.000000000","message":"Done","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"18aa5340d127126e09d82ab4d7e041da706648fa","unresolved":false,"context_lines":[{"line_number":1277,"context_line":"                if instance.uuid not in evacuated_instances:"},{"line_number":1278,"context_line":"                    self._init_instance(context, instance)"},{"line_number":1279,"context_line":""},{"line_number":1280,"context_line":"            # NOTE(gibi): collection all the instance uuids that is some way"},{"line_number":1281,"context_line":"            # already handled above. Either by init_instance or by"},{"line_number":1282,"context_line":"            # _destroy_evacuated_instances. This way we can limit the scope of"},{"line_number":1283,"context_line":"            # the _error_out_instances_whose_build_was_interrupted call to look"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_85fe6e03","line":1280,"range":{"start_line":1280,"start_character":26,"end_line":1280,"end_character":36},"in_reply_to":"3fa7e38b_6ab6a1dc","updated":"2019-09-17 14:17:50.000000000","message":"Done","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0dd876cdd8a329ce238bf0195b98bed4f53ff0e9","unresolved":false,"context_lines":[{"line_number":1278,"context_line":"                    self._init_instance(context, instance)"},{"line_number":1279,"context_line":""},{"line_number":1280,"context_line":"            # NOTE(gibi): collection all the instance uuids that is some way"},{"line_number":1281,"context_line":"            # already handled above. Either by init_instance or by"},{"line_number":1282,"context_line":"            # _destroy_evacuated_instances. This way we can limit the scope of"},{"line_number":1283,"context_line":"            # the _error_out_instances_whose_build_was_interrupted call to look"},{"line_number":1284,"context_line":"            # only instances that has allocation on this node and not handled"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_eac13130","line":1281,"range":{"start_line":1281,"start_character":14,"end_line":1281,"end_character":21},"updated":"2019-09-17 13:36:02.000000000","message":"was already","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"18aa5340d127126e09d82ab4d7e041da706648fa","unresolved":false,"context_lines":[{"line_number":1278,"context_line":"                    self._init_instance(context, instance)"},{"line_number":1279,"context_line":""},{"line_number":1280,"context_line":"            # NOTE(gibi): collection all the instance uuids that is some way"},{"line_number":1281,"context_line":"            # already handled above. Either by init_instance or by"},{"line_number":1282,"context_line":"            # _destroy_evacuated_instances. This way we can limit the scope of"},{"line_number":1283,"context_line":"            # the _error_out_instances_whose_build_was_interrupted call to look"},{"line_number":1284,"context_line":"            # only instances that has allocation on this node and not handled"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_c51b0671","line":1281,"range":{"start_line":1281,"start_character":14,"end_line":1281,"end_character":21},"in_reply_to":"3fa7e38b_eac13130","updated":"2019-09-17 14:17:50.000000000","message":"Done","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0dd876cdd8a329ce238bf0195b98bed4f53ff0e9","unresolved":false,"context_lines":[{"line_number":1281,"context_line":"            # already handled above. Either by init_instance or by"},{"line_number":1282,"context_line":"            # _destroy_evacuated_instances. This way we can limit the scope of"},{"line_number":1283,"context_line":"            # the _error_out_instances_whose_build_was_interrupted call to look"},{"line_number":1284,"context_line":"            # only instances that has allocation on this node and not handled"},{"line_number":1285,"context_line":"            # by the above calls."},{"line_number":1286,"context_line":"            already_handled \u003d {instance.uuid for instance in instances}.union("},{"line_number":1287,"context_line":"                evacuated_instances)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_0ad04df7","line":1284,"range":{"start_line":1284,"start_character":34,"end_line":1284,"end_character":37},"updated":"2019-09-17 13:36:02.000000000","message":"have allocations","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0dd876cdd8a329ce238bf0195b98bed4f53ff0e9","unresolved":false,"context_lines":[{"line_number":1281,"context_line":"            # already handled above. Either by init_instance or by"},{"line_number":1282,"context_line":"            # _destroy_evacuated_instances. This way we can limit the scope of"},{"line_number":1283,"context_line":"            # the _error_out_instances_whose_build_was_interrupted call to look"},{"line_number":1284,"context_line":"            # only instances that has allocation on this node and not handled"},{"line_number":1285,"context_line":"            # by the above calls."},{"line_number":1286,"context_line":"            already_handled \u003d {instance.uuid for instance in instances}.union("},{"line_number":1287,"context_line":"                evacuated_instances)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_4ae645eb","line":1284,"range":{"start_line":1284,"start_character":14,"end_line":1284,"end_character":18},"updated":"2019-09-17 13:36:02.000000000","message":"only for","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"18aa5340d127126e09d82ab4d7e041da706648fa","unresolved":false,"context_lines":[{"line_number":1281,"context_line":"            # already handled above. Either by init_instance or by"},{"line_number":1282,"context_line":"            # _destroy_evacuated_instances. This way we can limit the scope of"},{"line_number":1283,"context_line":"            # the _error_out_instances_whose_build_was_interrupted call to look"},{"line_number":1284,"context_line":"            # only instances that has allocation on this node and not handled"},{"line_number":1285,"context_line":"            # by the above calls."},{"line_number":1286,"context_line":"            already_handled \u003d {instance.uuid for instance in instances}.union("},{"line_number":1287,"context_line":"                evacuated_instances)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_85274eb7","line":1284,"range":{"start_line":1284,"start_character":34,"end_line":1284,"end_character":37},"in_reply_to":"3fa7e38b_0ad04df7","updated":"2019-09-17 14:17:50.000000000","message":"Done","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"18aa5340d127126e09d82ab4d7e041da706648fa","unresolved":false,"context_lines":[{"line_number":1281,"context_line":"            # already handled above. Either by init_instance or by"},{"line_number":1282,"context_line":"            # _destroy_evacuated_instances. This way we can limit the scope of"},{"line_number":1283,"context_line":"            # the _error_out_instances_whose_build_was_interrupted call to look"},{"line_number":1284,"context_line":"            # only instances that has allocation on this node and not handled"},{"line_number":1285,"context_line":"            # by the above calls."},{"line_number":1286,"context_line":"            already_handled \u003d {instance.uuid for instance in instances}.union("},{"line_number":1287,"context_line":"                evacuated_instances)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_a52cca99","line":1284,"range":{"start_line":1284,"start_character":14,"end_line":1284,"end_character":18},"in_reply_to":"3fa7e38b_4ae645eb","updated":"2019-09-17 14:17:50.000000000","message":"Done","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8ca50aad0a8f09bba64699b5e744dfded810a6c1","unresolved":false,"context_lines":[{"line_number":1283,"context_line":"            # the _error_out_instances_whose_build_was_interrupted call to look"},{"line_number":1284,"context_line":"            # only instances that has allocation on this node and not handled"},{"line_number":1285,"context_line":"            # by the above calls."},{"line_number":1286,"context_line":"            already_handled \u003d {instance.uuid for instance in instances}.union("},{"line_number":1287,"context_line":"                evacuated_instances)"},{"line_number":1288,"context_line":"            self._error_out_instances_whose_build_was_interrupted("},{"line_number":1289,"context_line":"                context, already_handled)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_ea8e11cf","line":1286,"range":{"start_line":1286,"start_character":71,"end_line":1286,"end_character":77},"updated":"2019-09-17 13:44:56.000000000","message":"huh, that could be a bit memory greedy but you\u0027re just unioning on strings that are UUIDs. Looks CERN-compatible (ie. even with computes running a lot of instances)","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"18aa5340d127126e09d82ab4d7e041da706648fa","unresolved":false,"context_lines":[{"line_number":1283,"context_line":"            # the _error_out_instances_whose_build_was_interrupted call to look"},{"line_number":1284,"context_line":"            # only instances that has allocation on this node and not handled"},{"line_number":1285,"context_line":"            # by the above calls."},{"line_number":1286,"context_line":"            already_handled \u003d {instance.uuid for instance in instances}.union("},{"line_number":1287,"context_line":"                evacuated_instances)"},{"line_number":1288,"context_line":"            self._error_out_instances_whose_build_was_interrupted("},{"line_number":1289,"context_line":"                context, already_handled)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_456f16c5","line":1286,"range":{"start_line":1286,"start_character":71,"end_line":1286,"end_character":77},"in_reply_to":"3fa7e38b_ea8e11cf","updated":"2019-09-17 14:17:50.000000000","message":"yep, these are just string UUIDs","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8ca50aad0a8f09bba64699b5e744dfded810a6c1","unresolved":false,"context_lines":[{"line_number":1311,"context_line":"        prevent keeping them in BUILDING state forever."},{"line_number":1312,"context_line":""},{"line_number":1313,"context_line":"        :param context: The request context"},{"line_number":1314,"context_line":"        :param already_handled_instances: The set of instance uuid that the"},{"line_number":1315,"context_line":"            host initialization process already handled in some way."},{"line_number":1316,"context_line":"        \"\"\""},{"line_number":1317,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_eaa7f14e","line":1314,"range":{"start_line":1314,"start_character":62,"end_line":1314,"end_character":66},"updated":"2019-09-17 13:44:56.000000000","message":"UUIDs","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"18aa5340d127126e09d82ab4d7e041da706648fa","unresolved":false,"context_lines":[{"line_number":1311,"context_line":"        prevent keeping them in BUILDING state forever."},{"line_number":1312,"context_line":""},{"line_number":1313,"context_line":"        :param context: The request context"},{"line_number":1314,"context_line":"        :param already_handled_instances: The set of instance uuid that the"},{"line_number":1315,"context_line":"            host initialization process already handled in some way."},{"line_number":1316,"context_line":"        \"\"\""},{"line_number":1317,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_c56226d9","line":1314,"range":{"start_line":1314,"start_character":62,"end_line":1314,"end_character":66},"in_reply_to":"3fa7e38b_eaa7f14e","updated":"2019-09-17 14:17:50.000000000","message":"Done","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8ca50aad0a8f09bba64699b5e744dfded810a6c1","unresolved":false,"context_lines":[{"line_number":1326,"context_line":"        for node_name in node_names:"},{"line_number":1327,"context_line":"            try:"},{"line_number":1328,"context_line":"                cn_uuid \u003d objects.ComputeNode.get_by_host_and_nodename("},{"line_number":1329,"context_line":"                    context, self.host, node_name).uuid"},{"line_number":1330,"context_line":"            except exception.ComputeHostNotFound:"},{"line_number":1331,"context_line":"                LOG.warning("},{"line_number":1332,"context_line":"                    \"Compute node %s not found in the database and therefore \""}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_aa501934","line":1329,"updated":"2019-09-17 13:44:56.000000000","message":"ouch, that\u0027s just a bit sad we need to collect the compute node UUID here again while there are so many other places where we could get it.","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3e3ade6640e7b7a05210b033370b17aa3a2f828d","unresolved":false,"context_lines":[{"line_number":1326,"context_line":"        for node_name in node_names:"},{"line_number":1327,"context_line":"            try:"},{"line_number":1328,"context_line":"                cn_uuid \u003d objects.ComputeNode.get_by_host_and_nodename("},{"line_number":1329,"context_line":"                    context, self.host, node_name).uuid"},{"line_number":1330,"context_line":"            except exception.ComputeHostNotFound:"},{"line_number":1331,"context_line":"                LOG.warning("},{"line_number":1332,"context_line":"                    \"Compute node %s not found in the database and therefore \""}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_3ddc6e73","line":1329,"in_reply_to":"3fa7e38b_45b156e1","updated":"2019-09-17 16:06:44.000000000","message":"I pulled up the node query to init_host in  https://review.opendev.org/682680","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"cd1a1a2f892e9a04aee21fe0dd80ab972a4ec666","unresolved":false,"context_lines":[{"line_number":1326,"context_line":"        for node_name in node_names:"},{"line_number":1327,"context_line":"            try:"},{"line_number":1328,"context_line":"                cn_uuid \u003d objects.ComputeNode.get_by_host_and_nodename("},{"line_number":1329,"context_line":"                    context, self.host, node_name).uuid"},{"line_number":1330,"context_line":"            except exception.ComputeHostNotFound:"},{"line_number":1331,"context_line":"                LOG.warning("},{"line_number":1332,"context_line":"                    \"Compute node %s not found in the database and therefore \""}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_c57546fc","line":1329,"in_reply_to":"3fa7e38b_a564caba","updated":"2019-09-17 14:17:29.000000000","message":"\u003e I\u0027m not sure what you mean - where do we get this before we get\n \u003e here during init_host?\n \u003e \n \u003e Note that init_host is called before pre_start_hook but if that\n \u003e were the other way around, we\u0027d have called ResourceTracker.update_available_resource\n \u003e and built the local ProviderTree cache and could have used that to\n \u003e avoid hitting the database but alas we can\u0027t change that ordering\n \u003e on service startup.\n \u003e \n\nYeah, I know. I was reffering to the fact we ask for the UUID and then we forget it, while after this, we ask again.\n\n \u003e In all but the ironic case this is going to be 1 node. In the\n \u003e ironic case, with CERN, this could be over 1000 nodes so yeah it\n \u003e could take awhile. Maybe it would be better to just pull the\n \u003e compute nodes for this host rather than one by one based on what\n \u003e the driver is reporting, but I don\u0027t know if we risk getting into\n \u003e rebalancing issues with ironic and doing that or not.\n \u003e \n \u003e If we do nothing else we should probably at least log something at\n \u003e the top of this method that we\u0027re going to look for unclaimed\n \u003e instances stuck in BUILDING status for nodes managed by this host.\n\nAgreed.","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"18aa5340d127126e09d82ab4d7e041da706648fa","unresolved":false,"context_lines":[{"line_number":1326,"context_line":"        for node_name in node_names:"},{"line_number":1327,"context_line":"            try:"},{"line_number":1328,"context_line":"                cn_uuid \u003d objects.ComputeNode.get_by_host_and_nodename("},{"line_number":1329,"context_line":"                    context, self.host, node_name).uuid"},{"line_number":1330,"context_line":"            except exception.ComputeHostNotFound:"},{"line_number":1331,"context_line":"                LOG.warning("},{"line_number":1332,"context_line":"                    \"Compute node %s not found in the database and therefore \""}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_45b156e1","line":1329,"in_reply_to":"3fa7e38b_a564caba","updated":"2019-09-17 14:17:50.000000000","message":"Added the LOG.\n\nThe _destroy_evacuated_instances also look for some of the compute nodes so we might be able to spare a db query if pull that up to init_host and pass down a cache. Let me do that in a separate patch.","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4038c016ded6abff35ebb12006cde6928c6ee7d3","unresolved":false,"context_lines":[{"line_number":1326,"context_line":"        for node_name in node_names:"},{"line_number":1327,"context_line":"            try:"},{"line_number":1328,"context_line":"                cn_uuid \u003d objects.ComputeNode.get_by_host_and_nodename("},{"line_number":1329,"context_line":"                    context, self.host, node_name).uuid"},{"line_number":1330,"context_line":"            except exception.ComputeHostNotFound:"},{"line_number":1331,"context_line":"                LOG.warning("},{"line_number":1332,"context_line":"                    \"Compute node %s not found in the database and therefore \""}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_a564caba","line":1329,"in_reply_to":"3fa7e38b_aa501934","updated":"2019-09-17 13:56:10.000000000","message":"I\u0027m not sure what you mean - where do we get this before we get here during init_host?\n\nNote that init_host is called before pre_start_hook but if that were the other way around, we\u0027d have called ResourceTracker.update_available_resource and built the local ProviderTree cache and could have used that to avoid hitting the database but alas we can\u0027t change that ordering on service startup.\n\nIn all but the ironic case this is going to be 1 node. In the ironic case, with CERN, this could be over 1000 nodes so yeah it could take awhile. Maybe it would be better to just pull the compute nodes for this host rather than one by one based on what the driver is reporting, but I don\u0027t know if we risk getting into rebalancing issues with ironic and doing that or not.\n\nIf we do nothing else we should probably at least log something at the top of this method that we\u0027re going to look for unclaimed instances stuck in BUILDING status for nodes managed by this host.","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0dd876cdd8a329ce238bf0195b98bed4f53ff0e9","unresolved":false,"context_lines":[{"line_number":1342,"context_line":"                LOG.error("},{"line_number":1343,"context_line":"                    \"Could not retrieve compute node resource provider %s and \""},{"line_number":1344,"context_line":"                    \"therefore unable to error out any instances stuck in \""},{"line_number":1345,"context_line":"                    \"BUILDING state. Error: %s\")"},{"line_number":1346,"context_line":"                continue"},{"line_number":1347,"context_line":""},{"line_number":1348,"context_line":"            not_handled_consumers \u003d (set(allocations) -"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_aa2fb9f4","line":1345,"range":{"start_line":1345,"start_character":47,"end_line":1345,"end_character":48},"updated":"2019-09-17 13:36:02.000000000","message":"You forgot the replacement variables for this log message.","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"18aa5340d127126e09d82ab4d7e041da706648fa","unresolved":false,"context_lines":[{"line_number":1342,"context_line":"                LOG.error("},{"line_number":1343,"context_line":"                    \"Could not retrieve compute node resource provider %s and \""},{"line_number":1344,"context_line":"                    \"therefore unable to error out any instances stuck in \""},{"line_number":1345,"context_line":"                    \"BUILDING state. Error: %s\")"},{"line_number":1346,"context_line":"                continue"},{"line_number":1347,"context_line":""},{"line_number":1348,"context_line":"            not_handled_consumers \u003d (set(allocations) -"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_a5d60a4f","line":1345,"range":{"start_line":1345,"start_character":47,"end_line":1345,"end_character":48},"in_reply_to":"3fa7e38b_aa2fb9f4","updated":"2019-09-17 14:17:50.000000000","message":"Done","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8ca50aad0a8f09bba64699b5e744dfded810a6c1","unresolved":false,"context_lines":[{"line_number":1357,"context_line":"            }"},{"line_number":1358,"context_line":""},{"line_number":1359,"context_line":"            instances \u003d objects.InstanceList.get_by_filters("},{"line_number":1360,"context_line":"                context, filters, expected_attrs\u003d[])"},{"line_number":1361,"context_line":""},{"line_number":1362,"context_line":"            for instance in instances:"},{"line_number":1363,"context_line":"                LOG.debug("}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_ca2d55a9","line":1360,"updated":"2019-09-17 13:44:56.000000000","message":"we already had that list of instances above, could we prevent doing another DB hit and just use the list we have in memory ? (nit: we could dict it by keying on UUIDs if that would ease)\n\nOr do you *really* want to get the latest status of the instances ? I don\u0027t see the reason for this case.","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"18aa5340d127126e09d82ab4d7e041da706648fa","unresolved":false,"context_lines":[{"line_number":1357,"context_line":"            }"},{"line_number":1358,"context_line":""},{"line_number":1359,"context_line":"            instances \u003d objects.InstanceList.get_by_filters("},{"line_number":1360,"context_line":"                context, filters, expected_attrs\u003d[])"},{"line_number":1361,"context_line":""},{"line_number":1362,"context_line":"            for instance in instances:"},{"line_number":1363,"context_line":"                LOG.debug("}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_855f4ee4","line":1360,"in_reply_to":"3fa7e38b_05127e59","updated":"2019-09-17 14:17:50.000000000","message":"I don\u0027t see an instance list for instances with instance.host !\u003d self.host . Please note that L1262 only reads instances where instance.host \u003d\u003d self.host","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"cd1a1a2f892e9a04aee21fe0dd80ab972a4ec666","unresolved":false,"context_lines":[{"line_number":1357,"context_line":"            }"},{"line_number":1358,"context_line":""},{"line_number":1359,"context_line":"            instances \u003d objects.InstanceList.get_by_filters("},{"line_number":1360,"context_line":"                context, filters, expected_attrs\u003d[])"},{"line_number":1361,"context_line":""},{"line_number":1362,"context_line":"            for instance in instances:"},{"line_number":1363,"context_line":"                LOG.debug("}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_85ef4e86","line":1360,"in_reply_to":"3fa7e38b_45a4f608","updated":"2019-09-17 14:17:29.000000000","message":"Oh, fsck, you\u0027re right. If they\u0027re on BUILD, we won\u0027t get them by L1262.","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4038c016ded6abff35ebb12006cde6928c6ee7d3","unresolved":false,"context_lines":[{"line_number":1357,"context_line":"            }"},{"line_number":1358,"context_line":""},{"line_number":1359,"context_line":"            instances \u003d objects.InstanceList.get_by_filters("},{"line_number":1360,"context_line":"                context, filters, expected_attrs\u003d[])"},{"line_number":1361,"context_line":""},{"line_number":1362,"context_line":"            for instance in instances:"},{"line_number":1363,"context_line":"                LOG.debug("}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_45a4f608","line":1360,"in_reply_to":"3fa7e38b_ca2d55a9","updated":"2019-09-17 13:56:10.000000000","message":"\u003e we already had that list of instances above, could we prevent doing\n \u003e another DB hit and just use the list we have in memory ? (nit: we\n \u003e could dict it by keying on UUIDs if that would ease)\n \u003e \n \u003e Or do you *really* want to get the latest status of the instances ?\n \u003e I don\u0027t see the reason for this case.\n\nIf you\u0027re talking about the list of instances we get in init_host from L1262 that\u0027s filtering on the host and in this case the instances we care about are stuck in BUILDING status before the instance_claim set the instance host, so the instances we care about won\u0027t be in that list. See my comments about this in PS7 (it took me a second to make the connection).","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8064bd778ad5f5d9237efdcbcaa9538f5c72971c","unresolved":false,"context_lines":[{"line_number":1357,"context_line":"            }"},{"line_number":1358,"context_line":""},{"line_number":1359,"context_line":"            instances \u003d objects.InstanceList.get_by_filters("},{"line_number":1360,"context_line":"                context, filters, expected_attrs\u003d[])"},{"line_number":1361,"context_line":""},{"line_number":1362,"context_line":"            for instance in instances:"},{"line_number":1363,"context_line":"                LOG.debug("}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_05127e59","line":1360,"in_reply_to":"3fa7e38b_ca2d55a9","updated":"2019-09-17 13:45:59.000000000","message":"Just a note, it\u0027s not just a DB hit, it\u0027s another MQ roundtrip since we\u0027re on the compute node.","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c82b527366ddd78a3c69057c7854a49db1a7038d","unresolved":false,"context_lines":[{"line_number":1318,"context_line":"        # 3) Check which remaining consumer is an instance in BUILDING state"},{"line_number":1319,"context_line":"        #    and push it to ERROR state."},{"line_number":1320,"context_line":""},{"line_number":1321,"context_line":"        LOG.info(_(\"Looking for unclaimed instances stuck in BUILDING status \""},{"line_number":1322,"context_line":"                   \"for nodes managed by this host\"))"},{"line_number":1323,"context_line":"        node_names \u003d self.driver.get_available_nodes()"},{"line_number":1324,"context_line":"        for node_name in node_names:"}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa7e38b_45738181","line":1321,"range":{"start_line":1321,"start_character":17,"end_line":1321,"end_character":18},"updated":"2019-09-18 13:28:58.000000000","message":"We don\u0027t need to mark this for translation.","commit_id":"32d0020a3aa598d95ffb2efbece73846f4e2cc47"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"30852bd78261f81c326719bc7d657d44168a87b6","unresolved":false,"context_lines":[{"line_number":1318,"context_line":"        # 3) Check which remaining consumer is an instance in BUILDING state"},{"line_number":1319,"context_line":"        #    and push it to ERROR state."},{"line_number":1320,"context_line":""},{"line_number":1321,"context_line":"        LOG.info(_(\"Looking for unclaimed instances stuck in BUILDING status \""},{"line_number":1322,"context_line":"                   \"for nodes managed by this host\"))"},{"line_number":1323,"context_line":"        node_names \u003d self.driver.get_available_nodes()"},{"line_number":1324,"context_line":"        for node_name in node_names:"}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa7e38b_086da097","line":1321,"range":{"start_line":1321,"start_character":17,"end_line":1321,"end_character":18},"in_reply_to":"3fa7e38b_45738181","updated":"2019-09-18 15:08:50.000000000","message":"Done","commit_id":"32d0020a3aa598d95ffb2efbece73846f4e2cc47"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c82b527366ddd78a3c69057c7854a49db1a7038d","unresolved":false,"context_lines":[{"line_number":1320,"context_line":""},{"line_number":1321,"context_line":"        LOG.info(_(\"Looking for unclaimed instances stuck in BUILDING status \""},{"line_number":1322,"context_line":"                   \"for nodes managed by this host\"))"},{"line_number":1323,"context_line":"        node_names \u003d self.driver.get_available_nodes()"},{"line_number":1324,"context_line":"        for node_name in node_names:"},{"line_number":1325,"context_line":"            try:"},{"line_number":1326,"context_line":"                cn_uuid \u003d objects.ComputeNode.get_by_host_and_nodename("}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa7e38b_6570fd73","line":1323,"updated":"2019-09-18 13:28:58.000000000","message":"We need to handle VirtDriverNotReady for ironic here:\n\nhttps://zuul.opendev.org/t/openstack/build/e1e3b4d13061439ab26e5aedad5c6891/log/controller/logs/screen-n-cpu.txt.gz#889\n\nThis is when we start nova-compute before ironic-api is available. If we fail here we lose any init_host processing that comes after this.","commit_id":"32d0020a3aa598d95ffb2efbece73846f4e2cc47"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"30852bd78261f81c326719bc7d657d44168a87b6","unresolved":false,"context_lines":[{"line_number":1320,"context_line":""},{"line_number":1321,"context_line":"        LOG.info(_(\"Looking for unclaimed instances stuck in BUILDING status \""},{"line_number":1322,"context_line":"                   \"for nodes managed by this host\"))"},{"line_number":1323,"context_line":"        node_names \u003d self.driver.get_available_nodes()"},{"line_number":1324,"context_line":"        for node_name in node_names:"},{"line_number":1325,"context_line":"            try:"},{"line_number":1326,"context_line":"                cn_uuid \u003d objects.ComputeNode.get_by_host_and_nodename("}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa7e38b_a8048c7c","line":1323,"in_reply_to":"3fa7e38b_6570fd73","updated":"2019-09-18 15:08:50.000000000","message":"Done","commit_id":"32d0020a3aa598d95ffb2efbece73846f4e2cc47"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c82b527366ddd78a3c69057c7854a49db1a7038d","unresolved":false,"context_lines":[{"line_number":1326,"context_line":"                cn_uuid \u003d objects.ComputeNode.get_by_host_and_nodename("},{"line_number":1327,"context_line":"                    context, self.host, node_name).uuid"},{"line_number":1328,"context_line":"            except exception.ComputeHostNotFound:"},{"line_number":1329,"context_line":"                LOG.warning("},{"line_number":1330,"context_line":"                    \"Compute node %s not found in the database and therefore \""},{"line_number":1331,"context_line":"                    \"unable to error out any instances stuck in BUILDING \""},{"line_number":1332,"context_line":"                    \"state on this node.\", node_name)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa7e38b_256a0580","line":1329,"updated":"2019-09-18 13:28:58.000000000","message":"We\u0027re going to this on every startup:\n\nhttps://zuul.opendev.org/t/openstack/build/e1e3b4d13061439ab26e5aedad5c6891/log/controller/logs/screen-n-cpu.txt.gz#1796\n\nSince init_host is called before pre_start_hook which calls RT.update_available_resource which is what creates the compute node record. So either we should change this to INFO or add something to the message like the other warning message in the logs that comes after this, i.e. something along the lines of saying if this is the first time starting this compute service you can ignore the message.","commit_id":"32d0020a3aa598d95ffb2efbece73846f4e2cc47"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"30852bd78261f81c326719bc7d657d44168a87b6","unresolved":false,"context_lines":[{"line_number":1326,"context_line":"                cn_uuid \u003d objects.ComputeNode.get_by_host_and_nodename("},{"line_number":1327,"context_line":"                    context, self.host, node_name).uuid"},{"line_number":1328,"context_line":"            except exception.ComputeHostNotFound:"},{"line_number":1329,"context_line":"                LOG.warning("},{"line_number":1330,"context_line":"                    \"Compute node %s not found in the database and therefore \""},{"line_number":1331,"context_line":"                    \"unable to error out any instances stuck in BUILDING \""},{"line_number":1332,"context_line":"                    \"state on this node.\", node_name)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa7e38b_683bf437","line":1329,"in_reply_to":"3fa7e38b_256a0580","updated":"2019-09-18 15:08:50.000000000","message":"Done","commit_id":"32d0020a3aa598d95ffb2efbece73846f4e2cc47"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"80d252222a4ba413400f80cba1bae2b2829b53d6","unresolved":false,"context_lines":[{"line_number":1281,"context_line":"            # handled by the above calls."},{"line_number":1282,"context_line":"            already_handled \u003d {instance.uuid for instance in instances}.union("},{"line_number":1283,"context_line":"                evacuated_instances)"},{"line_number":1284,"context_line":"            self._error_out_instances_whose_build_was_interrupted("},{"line_number":1285,"context_line":"                context, already_handled)"},{"line_number":1286,"context_line":""},{"line_number":1287,"context_line":"        finally:"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_de789ef9","line":1284,"updated":"2019-09-18 15:25:10.000000000","message":"Following on my previous comments for ironic and vcenter driver slow start times, I wonder if we should leave a NOTE here that if this becomes problematic (slow start times with those drivers) we could consider adding a config option or driver capability flag to tell us if we should thread this out in the background on startup.","commit_id":"bd1b980e141db448c8b3da1fc066b2dabf92c6b1"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c70b8593dfe6766a823e258bcba7e29699cea5d3","unresolved":false,"context_lines":[{"line_number":1281,"context_line":"            # handled by the above calls."},{"line_number":1282,"context_line":"            already_handled \u003d {instance.uuid for instance in instances}.union("},{"line_number":1283,"context_line":"                evacuated_instances)"},{"line_number":1284,"context_line":"            self._error_out_instances_whose_build_was_interrupted("},{"line_number":1285,"context_line":"                context, already_handled)"},{"line_number":1286,"context_line":""},{"line_number":1287,"context_line":"        finally:"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_5a358cd9","line":1284,"in_reply_to":"3fa7e38b_de789ef9","updated":"2019-09-19 07:58:26.000000000","message":"added a note","commit_id":"bd1b980e141db448c8b3da1fc066b2dabf92c6b1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"80d252222a4ba413400f80cba1bae2b2829b53d6","unresolved":false,"context_lines":[{"line_number":1338,"context_line":"                LOG.warning("},{"line_number":1339,"context_line":"                    \"Compute node %s not found in the database and therefore \""},{"line_number":1340,"context_line":"                    \"unable to error out any instances stuck in BUILDING \""},{"line_number":1341,"context_line":"                    \"state on this node. If this is the first time this \""},{"line_number":1342,"context_line":"                    \"service is starting on this host, then you can ignore \""},{"line_number":1343,"context_line":"                    \"this warning.\", node_name)"},{"line_number":1344,"context_line":"                continue"},{"line_number":1345,"context_line":""},{"line_number":1346,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_fe18fad3","line":1343,"range":{"start_line":1341,"start_character":41,"end_line":1343,"end_character":34},"updated":"2019-09-18 15:25:10.000000000","message":"I\u0027m thinking this should also go into the warning with VirtDriverNotReady above.","commit_id":"bd1b980e141db448c8b3da1fc066b2dabf92c6b1"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c70b8593dfe6766a823e258bcba7e29699cea5d3","unresolved":false,"context_lines":[{"line_number":1338,"context_line":"                LOG.warning("},{"line_number":1339,"context_line":"                    \"Compute node %s not found in the database and therefore \""},{"line_number":1340,"context_line":"                    \"unable to error out any instances stuck in BUILDING \""},{"line_number":1341,"context_line":"                    \"state on this node. If this is the first time this \""},{"line_number":1342,"context_line":"                    \"service is starting on this host, then you can ignore \""},{"line_number":1343,"context_line":"                    \"this warning.\", node_name)"},{"line_number":1344,"context_line":"                continue"},{"line_number":1345,"context_line":""},{"line_number":1346,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_9a40e437","line":1343,"range":{"start_line":1341,"start_character":41,"end_line":1343,"end_character":34},"in_reply_to":"3fa7e38b_fe18fad3","updated":"2019-09-19 07:58:26.000000000","message":"Done","commit_id":"bd1b980e141db448c8b3da1fc066b2dabf92c6b1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"26d952f96376b5203b1c34e0450bd942c3f0cc4e","unresolved":false,"context_lines":[{"line_number":1961,"context_line":"            # locked because we could wait in line to build this instance"},{"line_number":1962,"context_line":"            # for a while and we want to make sure that nothing else tries"},{"line_number":1963,"context_line":"            # to do anything with this instance while we wait."},{"line_number":1964,"context_line":"            with self._build_semaphore:"},{"line_number":1965,"context_line":"                try:"},{"line_number":1966,"context_line":"                    result \u003d self._do_build_and_run_instance(*args, **kwargs)"},{"line_number":1967,"context_line":"                except Exception:"}],"source_content_type":"text/x-python","patch_set":12,"id":"3fa7e38b_80870e10","line":1964,"updated":"2019-09-19 15:32:59.000000000","message":"Random musing but I was thinking about how if we had something tracking instances to build held outside the lock and then removed them when we gained the lock (not really this level, more like within rt.instance_claim), when shutting down the service we could at least log the instance uuids that are pending a build to help later debugging. Or even writing out a file to the host on shutdown if there are pending builds so we could easily read that file on restart and put those instances into ERROR state if they don\u0027t have a host set (then we wouldn\u0027t need to get allocations and all that from placement). Anyway, those are kind of pie in the sky ideas and I\u0027m not sure they are very good, just something I was thinking about while thinking about this change. If the RT tracked what was in the queue for the big lock and the compute manager could do something with that on shutdown/restart it could be useful, but it\u0027s a fuzzy idea at the moment.","commit_id":"f382054260f976ebd0f7b66950c4d091f331d9e1"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9f74f54ce6453ae0b441115b3adce5df639f6a24","unresolved":false,"context_lines":[{"line_number":1961,"context_line":"            # locked because we could wait in line to build this instance"},{"line_number":1962,"context_line":"            # for a while and we want to make sure that nothing else tries"},{"line_number":1963,"context_line":"            # to do anything with this instance while we wait."},{"line_number":1964,"context_line":"            with self._build_semaphore:"},{"line_number":1965,"context_line":"                try:"},{"line_number":1966,"context_line":"                    result \u003d self._do_build_and_run_instance(*args, **kwargs)"},{"line_number":1967,"context_line":"                except Exception:"}],"source_content_type":"text/x-python","patch_set":12,"id":"3fa7e38b_e976bca4","line":1964,"in_reply_to":"3fa7e38b_80870e10","updated":"2019-09-23 13:08:53.000000000","message":"It would be a half solution as this does not handle the case when the compute crashes mid-flight. I guess we could add a new field `scheduled_to` to the instance object (and persist it) and set instance.scheduled_to in the scheduler.","commit_id":"f382054260f976ebd0f7b66950c4d091f331d9e1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"13169d339b6b3d68e932cba4a681785a1049c346","unresolved":false,"context_lines":[{"line_number":691,"context_line":"            evacuations \u003d objects.MigrationList.get_by_filters(context,"},{"line_number":692,"context_line":"                                                               filters)"},{"line_number":693,"context_line":"        if not evacuations:"},{"line_number":694,"context_line":"            return {}"},{"line_number":695,"context_line":"        evacuations \u003d {mig.instance_uuid: mig for mig in evacuations}"},{"line_number":696,"context_line":""},{"line_number":697,"context_line":"        # TODO(mriedem): We could optimize by pre-loading the joined fields"}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_d9edeab7","line":694,"range":{"start_line":694,"start_character":19,"end_line":694,"end_character":21},"updated":"2019-10-07 18:08:31.000000000","message":"✔","commit_id":"a1a735bc6efa40d8277c9fc5339f3b74f968b58e"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"13169d339b6b3d68e932cba4a681785a1049c346","unresolved":false,"context_lines":[{"line_number":927,"context_line":"            # instance has already been scheduled to this particular host."},{"line_number":928,"context_line":"            LOG.debug(\"Instance failed to spawn correctly, \""},{"line_number":929,"context_line":"                      \"setting to ERROR state\", instance\u003dinstance)"},{"line_number":930,"context_line":"            self._set_instance_obj_error_state("},{"line_number":931,"context_line":"                context, instance, clean_task_state\u003dTrue)"},{"line_number":932,"context_line":"            return"},{"line_number":933,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_99df720b","line":930,"updated":"2019-10-07 18:08:31.000000000","message":"afaict these two deltas are unrelated (but good)","commit_id":"a1a735bc6efa40d8277c9fc5339f3b74f968b58e"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"13169d339b6b3d68e932cba4a681785a1049c346","unresolved":false,"context_lines":[{"line_number":1327,"context_line":""},{"line_number":1328,"context_line":"        try:"},{"line_number":1329,"context_line":"            # checking that instance was not already evacuated to other host"},{"line_number":1330,"context_line":"            evacuated_instances \u003d self._destroy_evacuated_instances(context)"},{"line_number":1331,"context_line":""},{"line_number":1332,"context_line":"            # Initialise instances on the host that are not evacuating"},{"line_number":1333,"context_line":"            for instance in instances:"}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_b9f26e99","line":1330,"range":{"start_line":1330,"start_character":12,"end_line":1330,"end_character":31},"updated":"2019-10-07 18:08:31.000000000","message":"now guaranteed to be nonempty ✔","commit_id":"a1a735bc6efa40d8277c9fc5339f3b74f968b58e"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"13169d339b6b3d68e932cba4a681785a1049c346","unresolved":false,"context_lines":[{"line_number":1334,"context_line":"                if instance.uuid not in evacuated_instances:"},{"line_number":1335,"context_line":"                    self._init_instance(context, instance)"},{"line_number":1336,"context_line":""},{"line_number":1337,"context_line":"            # NOTE(gibi): collect all the instance uuids that is in some way"},{"line_number":1338,"context_line":"            # was already handled above. Either by init_instance or by"},{"line_number":1339,"context_line":"            # _destroy_evacuated_instances. This way we can limit the scope of"},{"line_number":1340,"context_line":"            # the _error_out_instances_whose_build_was_interrupted call to look"}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_d9d40aec","line":1337,"range":{"start_line":1337,"start_character":62,"end_line":1337,"end_character":64},"updated":"2019-10-07 18:08:31.000000000","message":"were","commit_id":"a1a735bc6efa40d8277c9fc5339f3b74f968b58e"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"13169d339b6b3d68e932cba4a681785a1049c346","unresolved":false,"context_lines":[{"line_number":1335,"context_line":"                    self._init_instance(context, instance)"},{"line_number":1336,"context_line":""},{"line_number":1337,"context_line":"            # NOTE(gibi): collect all the instance uuids that is in some way"},{"line_number":1338,"context_line":"            # was already handled above. Either by init_instance or by"},{"line_number":1339,"context_line":"            # _destroy_evacuated_instances. This way we can limit the scope of"},{"line_number":1340,"context_line":"            # the _error_out_instances_whose_build_was_interrupted call to look"},{"line_number":1341,"context_line":"            # only for instances that have allocations on this node and not"}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_39ff5e68","line":1338,"range":{"start_line":1338,"start_character":14,"end_line":1338,"end_character":17},"updated":"2019-10-07 18:08:31.000000000","message":"x","commit_id":"a1a735bc6efa40d8277c9fc5339f3b74f968b58e"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"fcd8386afdeb960c7f6c8e4031cdc1f9e3fe8562","unresolved":false,"context_lines":[{"line_number":1345,"context_line":"            # NOTE(gibi): If ironic and vcenter virt driver slow start time"},{"line_number":1346,"context_line":"            # becomes problematic here then we should consider adding a config"},{"line_number":1347,"context_line":"            # option or a driver flag to tell us if we should thread this out"},{"line_number":1348,"context_line":"            # in the background on startup"},{"line_number":1349,"context_line":"            self._error_out_instances_whose_build_was_interrupted("},{"line_number":1350,"context_line":"                context, already_handled)"},{"line_number":1351,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_fef76cd3","line":1348,"updated":"2019-10-07 16:51:46.000000000","message":"this seems like the right idea to me: do it, see if it causes trouble, if it does, fix it\n\nFor both ironic and vcenter it could potentially huge numbers of instances, but we\u0027d have to have several stars aligned for that","commit_id":"a1a735bc6efa40d8277c9fc5339f3b74f968b58e"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"13169d339b6b3d68e932cba4a681785a1049c346","unresolved":false,"context_lines":[{"line_number":1345,"context_line":"            # NOTE(gibi): If ironic and vcenter virt driver slow start time"},{"line_number":1346,"context_line":"            # becomes problematic here then we should consider adding a config"},{"line_number":1347,"context_line":"            # option or a driver flag to tell us if we should thread this out"},{"line_number":1348,"context_line":"            # in the background on startup"},{"line_number":1349,"context_line":"            self._error_out_instances_whose_build_was_interrupted("},{"line_number":1350,"context_line":"                context, already_handled)"},{"line_number":1351,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_991692a7","line":1348,"in_reply_to":"3fa7e38b_fef76cd3","updated":"2019-10-07 18:08:31.000000000","message":"\u003e several stars aligned for that\n\nLike we were building all of those instances when the compute service was restarted? Yeah, I\u0027m good with those odds.","commit_id":"a1a735bc6efa40d8277c9fc5339f3b74f968b58e"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"13169d339b6b3d68e932cba4a681785a1049c346","unresolved":false,"context_lines":[{"line_number":1395,"context_line":"                \"instances stuck in BUILDING state on this node. If this is \""},{"line_number":1396,"context_line":"                \"the first time this service is starting on this host, then \""},{"line_number":1397,"context_line":"                \"you can ignore this warning.\")"},{"line_number":1398,"context_line":"            return"},{"line_number":1399,"context_line":""},{"line_number":1400,"context_line":"        for node_name in node_names:"},{"line_number":1401,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_79c63619","line":1398,"range":{"start_line":1398,"start_character":12,"end_line":1398,"end_character":18},"updated":"2019-10-07 18:08:31.000000000","message":"Hm, this concerns me a bit. Seems like this is a frequent occurrence for the ironic driver e.g. when bringing my cloud back up after an outage or maintenance window. In that case, what, I would have to restart my compute again to get them cleaned up?\n\nCould we consider a retry instead?","commit_id":"a1a735bc6efa40d8277c9fc5339f3b74f968b58e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2787136472767f75766c03937ca64b6f43e5949b","unresolved":false,"context_lines":[{"line_number":1395,"context_line":"                \"instances stuck in BUILDING state on this node. If this is \""},{"line_number":1396,"context_line":"                \"the first time this service is starting on this host, then \""},{"line_number":1397,"context_line":"                \"you can ignore this warning.\")"},{"line_number":1398,"context_line":"            return"},{"line_number":1399,"context_line":""},{"line_number":1400,"context_line":"        for node_name in node_names:"},{"line_number":1401,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_54ad3f99","line":1398,"range":{"start_line":1398,"start_character":12,"end_line":1398,"end_character":18},"in_reply_to":"3fa7e38b_79c63619","updated":"2019-10-07 18:45:03.000000000","message":"I would think/hope that most production deployment tools (not devstack) would be smarter about order of operations wrt ironic and nova. It\u0027s long been asserted that ironic should be upgraded before nova because nova-compute historically did not to version discovery/compat with the ironic API, so I would think most production deployments (CERN could verify) are starting up ironic before nova.","commit_id":"a1a735bc6efa40d8277c9fc5339f3b74f968b58e"}],"nova/tests/functional/regressions/test_bug_1833581.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"58ffde38a15014c99fbaeb415650b60c93bca251","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"9fb8cfa7_394e1797","line":83,"updated":"2019-06-27 19:54:03.000000000","message":"✔","commit_id":"fec9f649c07c76b6700fe93c4fecc79123964753"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"27998877d3018d1a8863e91c44bdfc831cc991c4","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        # There is another way to trigger the issue. We can inject a sleep into"},{"line_number":50,"context_line":"        # instance_claim() to stop it. This is less realistic but it works in"},{"line_number":51,"context_line":"        # the test env."},{"line_number":52,"context_line":"        self.flags(instance_build_timeout\u003d1)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"        server_req \u003d self._build_minimal_create_server_request("},{"line_number":55,"context_line":"            self.api, \u0027interrupted-server\u0027, flavor_id\u003dself.flavor1[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":5,"id":"7faddb67_6b25a708","line":52,"updated":"2019-08-01 16:03:30.000000000","message":"Can this be removed now?","commit_id":"05992960e6ea4add6e3c256978907bbcdecbd7dc"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ed4dc94201b7bbcb17e0ea0dbade5f706a3197a6","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        # There is another way to trigger the issue. We can inject a sleep into"},{"line_number":50,"context_line":"        # instance_claim() to stop it. This is less realistic but it works in"},{"line_number":51,"context_line":"        # the test env."},{"line_number":52,"context_line":"        self.flags(instance_build_timeout\u003d1)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"        server_req \u003d self._build_minimal_create_server_request("},{"line_number":55,"context_line":"            self.api, \u0027interrupted-server\u0027, flavor_id\u003dself.flavor1[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":5,"id":"7faddb67_0a17e247","line":52,"in_reply_to":"7faddb67_6b25a708","updated":"2019-08-08 12:49:32.000000000","message":"It was removed in PS6.","commit_id":"05992960e6ea4add6e3c256978907bbcdecbd7dc"}],"nova/tests/unit/compute/test_compute_mgr.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0ac0435bd3134d0652882e5ae08e6a1cf6891934","unresolved":false,"context_lines":[{"line_number":1077,"context_line":"            report.ProviderAllocInfo(allocations\u003d{})"},{"line_number":1078,"context_line":"        ]"},{"line_number":1079,"context_line":""},{"line_number":1080,"context_line":"        self.compute.init_host()"},{"line_number":1081,"context_line":""},{"line_number":1082,"context_line":"        # check that nova skip the node that is not found in placement and"},{"line_number":1083,"context_line":"        # continue with the next"}],"source_content_type":"text/x-python","patch_set":7,"id":"5faad753_d186bcb9","line":1080,"range":{"start_line":1080,"start_character":21,"end_line":1080,"end_character":30},"updated":"2019-09-16 13:44:22.000000000","message":"Why not just call _error_out_instances_whose_build_was_interrupted directly and avoid the init_host mocks on this test? Same for the other tests above. The tests are mixing mocks to handle init_host and _error_out_instances_whose_build_was_interrupted but since these are unit tests why not just test the logic change to init_host by mocking _error_out_instances_whose_build_was_interrupted and then test _error_out_instances_whose_build_was_interrupted by calling it directly, not through init_host? It makes the test methods a lot bigger than they need to be.","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a4a9d50b7b0bfff0e1a22df26b1ab6523ebe4938","unresolved":false,"context_lines":[{"line_number":1077,"context_line":"            report.ProviderAllocInfo(allocations\u003d{})"},{"line_number":1078,"context_line":"        ]"},{"line_number":1079,"context_line":""},{"line_number":1080,"context_line":"        self.compute.init_host()"},{"line_number":1081,"context_line":""},{"line_number":1082,"context_line":"        # check that nova skip the node that is not found in placement and"},{"line_number":1083,"context_line":"        # continue with the next"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_bc9f07b3","line":1080,"range":{"start_line":1080,"start_character":21,"end_line":1080,"end_character":30},"in_reply_to":"5faad753_d186bcb9","updated":"2019-09-17 12:01:23.000000000","message":"Done","commit_id":"de0dfec9f01edc68d9b062ab0b3d28a3eb6e95c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0dd876cdd8a329ce238bf0195b98bed4f53ff0e9","unresolved":false,"context_lines":[{"line_number":965,"context_line":"            self.context, host\u003dNone, uuid\u003duuids.interrupted_instance,"},{"line_number":966,"context_line":"            vm_state\u003dvm_states.BUILDING)"},{"line_number":967,"context_line":""},{"line_number":968,"context_line":"        # we have 4 different instances. We need consumers for each instance"},{"line_number":969,"context_line":"        # in placement and an extra consumer that is not an instance"},{"line_number":970,"context_line":"        allocations \u003d {"},{"line_number":971,"context_line":"            uuids.active_instance: \"fake-resources-active\","}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_aa7d79e8","line":968,"range":{"start_line":968,"start_character":18,"end_line":968,"end_character":19},"updated":"2019-09-17 13:36:02.000000000","message":"I see 3 above. I guess you\u0027re saying we have 4 different instance consumers and 1 consumer that is not an instance.","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"18aa5340d127126e09d82ab4d7e041da706648fa","unresolved":false,"context_lines":[{"line_number":965,"context_line":"            self.context, host\u003dNone, uuid\u003duuids.interrupted_instance,"},{"line_number":966,"context_line":"            vm_state\u003dvm_states.BUILDING)"},{"line_number":967,"context_line":""},{"line_number":968,"context_line":"        # we have 4 different instances. We need consumers for each instance"},{"line_number":969,"context_line":"        # in placement and an extra consumer that is not an instance"},{"line_number":970,"context_line":"        allocations \u003d {"},{"line_number":971,"context_line":"            uuids.active_instance: \"fake-resources-active\","}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_450e36e6","line":968,"range":{"start_line":968,"start_character":18,"end_line":968,"end_character":19},"in_reply_to":"3fa7e38b_aa7d79e8","updated":"2019-09-17 14:17:50.000000000","message":"Done","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0dd876cdd8a329ce238bf0195b98bed4f53ff0e9","unresolved":false,"context_lines":[{"line_number":1011,"context_line":""},{"line_number":1012,"context_line":"    @mock.patch.object(objects.ComputeNode, \u0027get_by_host_and_nodename\u0027)"},{"line_number":1013,"context_line":"    @mock.patch.object(fake_driver.FakeDriver, \u0027get_available_nodes\u0027)"},{"line_number":1014,"context_line":"    def test_init_host_with_interrupted_instance_build_compute_node_not_found("},{"line_number":1015,"context_line":"            self, mock_get_nodes, mock_get_by_host_and_node):"},{"line_number":1016,"context_line":""},{"line_number":1017,"context_line":"        mock_get_nodes.return_value \u003d [\u0027fake-node1\u0027, \u0027fake-node2\u0027]"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_8aef5d86","line":1014,"updated":"2019-09-17 13:36:02.000000000","message":"Why doesn\u0027t this test have to mock out get_allocations_for_resource_provider? Does it just fail and get handled and continue?","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"18aa5340d127126e09d82ab4d7e041da706648fa","unresolved":false,"context_lines":[{"line_number":1011,"context_line":""},{"line_number":1012,"context_line":"    @mock.patch.object(objects.ComputeNode, \u0027get_by_host_and_nodename\u0027)"},{"line_number":1013,"context_line":"    @mock.patch.object(fake_driver.FakeDriver, \u0027get_available_nodes\u0027)"},{"line_number":1014,"context_line":"    def test_init_host_with_interrupted_instance_build_compute_node_not_found("},{"line_number":1015,"context_line":"            self, mock_get_nodes, mock_get_by_host_and_node):"},{"line_number":1016,"context_line":""},{"line_number":1017,"context_line":"        mock_get_nodes.return_value \u003d [\u0027fake-node1\u0027, \u0027fake-node2\u0027]"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_45b5d6ed","line":1014,"in_reply_to":"3fa7e38b_8aef5d86","updated":"2019-09-17 14:17:50.000000000","message":"yes. Now asserted the single call there too. Done.","commit_id":"afa5a015b7073de7dd58cfae55e3a5af110900a0"}]}
