)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aaa765f69974f85bd6e2fecc5345483f77e33af","unresolved":false,"context_lines":[{"line_number":1903,"context_line":"            self.compute_task_api.build_instances(context, [instance],"},{"line_number":1904,"context_line":"                    image, filter_properties, admin_password,"},{"line_number":1905,"context_line":"                    injected_files, requested_networks, security_groups,"},{"line_number":1906,"context_line":"                    block_device_mapping, [host_list])"},{"line_number":1907,"context_line":"            return build_results.RESCHEDULED"},{"line_number":1908,"context_line":"        except (exception.InstanceNotFound,"},{"line_number":1909,"context_line":"                exception.UnexpectedDeletingTaskStateError):"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_86b29e93","line":1906,"range":{"start_line":1906,"start_character":42,"end_line":1906,"end_character":53},"updated":"2017-12-06 15:25:52.000000000","message":"Why do we have to make this a list?","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9fe837f9fabeed5bf2ed1a709ce8d03e66624534","unresolved":false,"context_lines":[{"line_number":1903,"context_line":"            self.compute_task_api.build_instances(context, [instance],"},{"line_number":1904,"context_line":"                    image, filter_properties, admin_password,"},{"line_number":1905,"context_line":"                    injected_files, requested_networks, security_groups,"},{"line_number":1906,"context_line":"                    block_device_mapping, [host_list])"},{"line_number":1907,"context_line":"            return build_results.RESCHEDULED"},{"line_number":1908,"context_line":"        except (exception.InstanceNotFound,"},{"line_number":1909,"context_line":"                exception.UnexpectedDeletingTaskStateError):"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_f8bea363","line":1906,"range":{"start_line":1906,"start_character":42,"end_line":1906,"end_character":53},"in_reply_to":"df87a7cf_86b29e93","updated":"2017-12-06 20:35:17.000000000","message":"Because build_instances() requires a list of host_list for each instance. Same as the [instance] param just above on L1903.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aaa765f69974f85bd6e2fecc5345483f77e33af","unresolved":false,"context_lines":[{"line_number":1978,"context_line":""},{"line_number":1979,"context_line":"    def _build_and_run_instance(self, context, instance, image, injected_files,"},{"line_number":1980,"context_line":"            admin_password, requested_networks, security_groups,"},{"line_number":1981,"context_line":"            block_device_mapping, node, limits, filter_properties, host_list,"},{"line_number":1982,"context_line":"            request_spec\u003dNone):"},{"line_number":1983,"context_line":""},{"line_number":1984,"context_line":"        image_name \u003d image.get(\u0027name\u0027)"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_c6b8a677","line":1981,"range":{"start_line":1981,"start_character":67,"end_line":1981,"end_character":76},"updated":"2017-12-06 15:25:52.000000000","message":"This isn\u0027t used here, we can remove it.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9fe837f9fabeed5bf2ed1a709ce8d03e66624534","unresolved":false,"context_lines":[{"line_number":1978,"context_line":""},{"line_number":1979,"context_line":"    def _build_and_run_instance(self, context, instance, image, injected_files,"},{"line_number":1980,"context_line":"            admin_password, requested_networks, security_groups,"},{"line_number":1981,"context_line":"            block_device_mapping, node, limits, filter_properties, host_list,"},{"line_number":1982,"context_line":"            request_spec\u003dNone):"},{"line_number":1983,"context_line":""},{"line_number":1984,"context_line":"        image_name \u003d image.get(\u0027name\u0027)"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_b83b3be9","line":1981,"range":{"start_line":1981,"start_character":67,"end_line":1981,"end_character":76},"in_reply_to":"df87a7cf_c6b8a677","updated":"2017-12-06 20:35:17.000000000","message":"Ah, good catch.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"eb2ba452da3eada662438d966ba0d265d3ea4493","unresolved":false,"context_lines":[{"line_number":1902,"context_line":"            self.compute_task_api.build_instances(context, [instance],"},{"line_number":1903,"context_line":"                    image, filter_properties, admin_password,"},{"line_number":1904,"context_line":"                    injected_files, requested_networks, security_groups,"},{"line_number":1905,"context_line":"                    block_device_mapping, [host_list])"},{"line_number":1906,"context_line":"            return build_results.RESCHEDULED"},{"line_number":1907,"context_line":"        except (exception.InstanceNotFound,"},{"line_number":1908,"context_line":"                exception.UnexpectedDeletingTaskStateError):"}],"source_content_type":"text/x-python","patch_set":41,"id":"df87a7cf_d395a633","line":1905,"range":{"start_line":1905,"start_character":42,"end_line":1905,"end_character":53},"updated":"2017-12-18 21:56:46.000000000","message":"Use kwargs, you\u0027re passing this as the legacy_bdm parameter:\n\nhttps://review.openstack.org/#/c/511358/41/nova/conductor/rpcapi.py@331\n\nAnd that\u0027s why this evaluates to True:\n\nhttps://review.openstack.org/#/c/511358/41/nova/conductor/manager.py@554\n\nAnd we try to hit the scheduler again and explode.","commit_id":"3ee3b8379f43aa3570240d69f2718c1003265a0b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"38f48f2e0ebc2e85a02c795c92d59ebbfd30ccdb","unresolved":false,"context_lines":[{"line_number":1775,"context_line":"                        # to be claiming resources against it, so we want to"},{"line_number":1776,"context_line":"                        # reflect that same thing in Placement."},{"line_number":1777,"context_line":"                        rt \u003d self._get_resource_tracker()"},{"line_number":1778,"context_line":"                        rt.reportclient.delete_allocation_for_instance("},{"line_number":1779,"context_line":"                            instance.uuid)"},{"line_number":1780,"context_line":""},{"line_number":1781,"context_line":"                        self._build_failed()"},{"line_number":1782,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":43,"id":"df87a7cf_e2ec80bc","line":1779,"range":{"start_line":1778,"start_character":24,"end_line":1779,"end_character":42},"updated":"2017-12-19 14:48:14.000000000","message":"We have to do this just before we cast to build_instances, and only do this here in this block if result \u003d\u003d build_results.FAILED. We still need to call self._build_failed() as before, for either a FAILED or RESCHEDULED result.","commit_id":"ffdeab7a48aa47a8964ecbf82f492dd5391a2a8c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"076e397798bbeabecbac339553a129a154caf17f","unresolved":false,"context_lines":[{"line_number":1762,"context_line":"                finally:"},{"line_number":1763,"context_line":"                    if result \u003d\u003d build_results.FAILED:"},{"line_number":1764,"context_line":"                        # No need to call this for a reschedule, as the"},{"line_number":1765,"context_line":"                        # allocations will have already been removed."},{"line_number":1766,"context_line":"                        self._delete_allocation_for_instance(instance.uuid)"},{"line_number":1767,"context_line":""},{"line_number":1768,"context_line":"                    if result in (build_results.FAILED,"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_dd7c5cb7","line":1765,"range":{"start_line":1765,"start_character":61,"end_line":1765,"end_character":68},"updated":"2017-12-20 19:50:33.000000000","message":"\" in _do_build_and_run_instance.\" for clarity?","commit_id":"d3bf281f447a504f4a6f78a8dbdbeb3c62ce6c88"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"84fc6ff599003895fbf893bf070519720ebd9306","unresolved":false,"context_lines":[{"line_number":1762,"context_line":"                finally:"},{"line_number":1763,"context_line":"                    if result \u003d\u003d build_results.FAILED:"},{"line_number":1764,"context_line":"                        # No need to call this for a reschedule, as the"},{"line_number":1765,"context_line":"                        # allocations will have already been removed."},{"line_number":1766,"context_line":"                        self._delete_allocation_for_instance(instance.uuid)"},{"line_number":1767,"context_line":""},{"line_number":1768,"context_line":"                    if result in (build_results.FAILED,"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_9bd1fc5a","line":1765,"range":{"start_line":1765,"start_character":61,"end_line":1765,"end_character":68},"in_reply_to":"bf8cb3f7_dd7c5cb7","updated":"2017-12-20 22:15:54.000000000","message":"Done","commit_id":"d3bf281f447a504f4a6f78a8dbdbeb3c62ce6c88"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"076e397798bbeabecbac339553a129a154caf17f","unresolved":false,"context_lines":[{"line_number":1767,"context_line":""},{"line_number":1768,"context_line":"                    if result in (build_results.FAILED,"},{"line_number":1769,"context_line":"                                  build_results.RESCHEDULED):"},{"line_number":1770,"context_line":"                        # The instance.host is likely set to None in"},{"line_number":1771,"context_line":"                        # _do_build_and_run_instance which means if the user"},{"line_number":1772,"context_line":"                        # deletes the instance, it will be deleted in the API,"},{"line_number":1773,"context_line":"                        # not the compute service. Setting the instance.host to"},{"line_number":1774,"context_line":"                        # None in _do_build_and_run_instance means that the"},{"line_number":1775,"context_line":"                        # ResourceTracker will no longer consider this instance"},{"line_number":1776,"context_line":"                        # to be claiming resources against it."},{"line_number":1777,"context_line":"                        self._build_failed()"},{"line_number":1778,"context_line":"                    else:"},{"line_number":1779,"context_line":"                        self._failed_builds \u003d 0"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_7dbd1067","line":1776,"range":{"start_line":1770,"start_character":24,"end_line":1776,"end_character":62},"updated":"2017-12-20 19:50:33.000000000","message":"This comment was really about the context of the _delete_allocation_for_instance call, so it\u0027s a bit weird now. Could have just moved this into the block above instead of the comment you have there.","commit_id":"d3bf281f447a504f4a6f78a8dbdbeb3c62ce6c88"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"84fc6ff599003895fbf893bf070519720ebd9306","unresolved":false,"context_lines":[{"line_number":1767,"context_line":""},{"line_number":1768,"context_line":"                    if result in (build_results.FAILED,"},{"line_number":1769,"context_line":"                                  build_results.RESCHEDULED):"},{"line_number":1770,"context_line":"                        # The instance.host is likely set to None in"},{"line_number":1771,"context_line":"                        # _do_build_and_run_instance which means if the user"},{"line_number":1772,"context_line":"                        # deletes the instance, it will be deleted in the API,"},{"line_number":1773,"context_line":"                        # not the compute service. Setting the instance.host to"},{"line_number":1774,"context_line":"                        # None in _do_build_and_run_instance means that the"},{"line_number":1775,"context_line":"                        # ResourceTracker will no longer consider this instance"},{"line_number":1776,"context_line":"                        # to be claiming resources against it."},{"line_number":1777,"context_line":"                        self._build_failed()"},{"line_number":1778,"context_line":"                    else:"},{"line_number":1779,"context_line":"                        self._failed_builds \u003d 0"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_7b451817","line":1776,"range":{"start_line":1770,"start_character":24,"end_line":1776,"end_character":62},"in_reply_to":"bf8cb3f7_7dbd1067","updated":"2017-12-20 22:15:54.000000000","message":"Done","commit_id":"d3bf281f447a504f4a6f78a8dbdbeb3c62ce6c88"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"076e397798bbeabecbac339553a129a154caf17f","unresolved":false,"context_lines":[{"line_number":1895,"context_line":"            self._nil_out_instance_obj_host_and_node(instance)"},{"line_number":1896,"context_line":"            instance.task_state \u003d task_states.SCHEDULING"},{"line_number":1897,"context_line":"            instance.save()"},{"line_number":1898,"context_line":"            # Remove the allocations for the instance before casting to the"},{"line_number":1899,"context_line":"            # conductor."},{"line_number":1900,"context_line":"            self._delete_allocation_for_instance(instance.uuid)"},{"line_number":1901,"context_line":""},{"line_number":1902,"context_line":"            # TODO(mriedem): Pass the request_spec back to conductor so that"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_1d5c044a","line":1899,"range":{"start_line":1898,"start_character":12,"end_line":1899,"end_character":24},"updated":"2017-12-20 19:50:33.000000000","message":"I feel like we should expand on this a bit, because it was kind of tricky when we hit it in CI. I think the point is that we need to remove the allocations here before casting to conductor because conductor will claim resources on the next alternate host in the host_list during the reschedule (if there are any hosts left). To make things atomic, we need to make sure the allocations are gone for *this host* before doing the RPC cast, so we don\u0027t race with conductor trying to create new allocations for the next host in the reschedule loop. That\u0027s also why we can\u0027t rely on the finally block in _locked_do_build_and_run_instance to handle this for us, because that comes after we RPC cast to conductor.","commit_id":"d3bf281f447a504f4a6f78a8dbdbeb3c62ce6c88"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0c02daa1d26ef7255b60b216a81112410485794f","unresolved":false,"context_lines":[{"line_number":1762,"context_line":"                finally:"},{"line_number":1763,"context_line":"                    if result \u003d\u003d build_results.FAILED:"},{"line_number":1764,"context_line":"                        # Remove the allocation records from Placement for the"},{"line_number":1765,"context_line":"                        # instance if the build failed or is being rescheduled"},{"line_number":1766,"context_line":"                        # to another node. The instance.host is likely set to"},{"line_number":1767,"context_line":"                        # None in _do_build_and_run_instance which means if the"},{"line_number":1768,"context_line":"                        # user deletes the instance, it will be deleted in the"},{"line_number":1769,"context_line":"                        # API, not the compute service. Setting the"}],"source_content_type":"text/x-python","patch_set":46,"id":"bf8cb3f7_d51e6c6f","line":1766,"range":{"start_line":1765,"start_character":55,"end_line":1766,"end_character":41},"updated":"2017-12-21 02:17:52.000000000","message":"a bit confusing given the condition block we\u0027re in","commit_id":"a4e254ef3af26dac32521fa76ee7156df4f73eb3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"7a7bcdbb6157e743b873deb2e4774b72a2b61971","unresolved":false,"context_lines":[{"line_number":1870,"context_line":"                        fault_message\u003de.kwargs[\u0027reason\u0027])"},{"line_number":1871,"context_line":"                self._nil_out_instance_obj_host_and_node(instance)"},{"line_number":1872,"context_line":"                self._set_instance_obj_error_state(context, instance,"},{"line_number":1873,"context_line":"                                                   clean_task_state\u003dTrue)"},{"line_number":1874,"context_line":"                return build_results.FAILED"},{"line_number":1875,"context_line":"            LOG.debug(e.format_message(), instance\u003dinstance)"},{"line_number":1876,"context_line":"            # This will be used for logging the exception"}],"source_content_type":"text/x-python","patch_set":47,"id":"bf8cb3f7_cbaa3d84","line":1873,"updated":"2017-12-21 19:01:55.000000000","message":"why not call _delete_allocations_for_instance() here and then you wouldn\u0027t have to have the code block from line 1763-1777 at all...","commit_id":"f42f2b2e1f647d1e750c57fba26b70f095549b52"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0ae7887bff2c6752b41327f83039c28c6edb6143","unresolved":false,"context_lines":[{"line_number":1870,"context_line":"                        fault_message\u003de.kwargs[\u0027reason\u0027])"},{"line_number":1871,"context_line":"                self._nil_out_instance_obj_host_and_node(instance)"},{"line_number":1872,"context_line":"                self._set_instance_obj_error_state(context, instance,"},{"line_number":1873,"context_line":"                                                   clean_task_state\u003dTrue)"},{"line_number":1874,"context_line":"                return build_results.FAILED"},{"line_number":1875,"context_line":"            LOG.debug(e.format_message(), instance\u003dinstance)"},{"line_number":1876,"context_line":"            # This will be used for logging the exception"}],"source_content_type":"text/x-python","patch_set":47,"id":"bf8cb3f7_4b806d8c","line":1873,"in_reply_to":"bf8cb3f7_4be4edac","updated":"2017-12-21 19:15:25.000000000","message":"gotcha.","commit_id":"f42f2b2e1f647d1e750c57fba26b70f095549b52"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"181dea411b660ddc1782a00e1efba7dc46570df6","unresolved":false,"context_lines":[{"line_number":1870,"context_line":"                        fault_message\u003de.kwargs[\u0027reason\u0027])"},{"line_number":1871,"context_line":"                self._nil_out_instance_obj_host_and_node(instance)"},{"line_number":1872,"context_line":"                self._set_instance_obj_error_state(context, instance,"},{"line_number":1873,"context_line":"                                                   clean_task_state\u003dTrue)"},{"line_number":1874,"context_line":"                return build_results.FAILED"},{"line_number":1875,"context_line":"            LOG.debug(e.format_message(), instance\u003dinstance)"},{"line_number":1876,"context_line":"            # This will be used for logging the exception"}],"source_content_type":"text/x-python","patch_set":47,"id":"bf8cb3f7_4be4edac","line":1873,"in_reply_to":"bf8cb3f7_cbaa3d84","updated":"2017-12-21 19:12:31.000000000","message":"There are 4 places where we return build_results.FAILED in here, that\u0027s why it\u0027s handled generically in the finally block. Oh plus @hooks.add_hook(\u0027build_instance\u0027) I guess...\n\nNote that 99% of the code in these except blocks for failures is the same...but that\u0027s a cleanup for another day.","commit_id":"f42f2b2e1f647d1e750c57fba26b70f095549b52"}],"nova/compute/rpcapi.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aaa765f69974f85bd6e2fecc5345483f77e33af","unresolved":false,"context_lines":[{"line_number":335,"context_line":"        the version_cap being set to 4.18."},{"line_number":336,"context_line":""},{"line_number":337,"context_line":"        * 4.19 - build_and_run_instance() now gets a \u0027host_list\u0027 parameter"},{"line_number":338,"context_line":"                 representing potential alternate hosts for retries within a"},{"line_number":339,"context_line":"                 cell."},{"line_number":340,"context_line":"    \u0027\u0027\u0027"},{"line_number":341,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_4681f68e","line":338,"updated":"2017-12-06 15:25:52.000000000","message":"So is host_list a list, or a list of lists? Because the compute code is passing [host_list] back to cellconductor:build_instances when rescheduling.\n\nAlso, is the host_list[0] entry the same as the compute host that we run this on, or is that popped off so if I have selected hosts 1, 2, 3, 4, primary\u003d1 and alternates\u003d(2,3,4), when I\u0027m building on host1, will host_list contain 1 or will it just be the alternates? If the latter, we should consider renaming the variable from host_list to alternate_hosts.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9fe837f9fabeed5bf2ed1a709ce8d03e66624534","unresolved":false,"context_lines":[{"line_number":335,"context_line":"        the version_cap being set to 4.18."},{"line_number":336,"context_line":""},{"line_number":337,"context_line":"        * 4.19 - build_and_run_instance() now gets a \u0027host_list\u0027 parameter"},{"line_number":338,"context_line":"                 representing potential alternate hosts for retries within a"},{"line_number":339,"context_line":"                 cell."},{"line_number":340,"context_line":"    \u0027\u0027\u0027"},{"line_number":341,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_6c3c14c8","line":338,"in_reply_to":"df87a7cf_4681f68e","updated":"2017-12-06 20:35:17.000000000","message":"In this case (singular *instance) it is a list. In the plural (*instances) it is a list of lists.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aaa765f69974f85bd6e2fecc5345483f77e33af","unresolved":false,"context_lines":[{"line_number":1122,"context_line":"    def build_and_run_instance(self, ctxt, instance, host, image, request_spec,"},{"line_number":1123,"context_line":"            filter_properties, admin_password\u003dNone, injected_files\u003dNone,"},{"line_number":1124,"context_line":"            requested_networks\u003dNone, security_groups\u003dNone,"},{"line_number":1125,"context_line":"            block_device_mapping\u003dNone, node\u003dNone, limits\u003dNone,"},{"line_number":1126,"context_line":"            host_list\u003dNone):"},{"line_number":1127,"context_line":"        kwargs \u003d {\"instance\": instance,"},{"line_number":1128,"context_line":"                  \"image\": image,"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_e6d4cabf","line":1125,"range":{"start_line":1125,"start_character":50,"end_line":1125,"end_character":56},"updated":"2017-12-06 15:25:52.000000000","message":"In this RPC API version bump, we should probably also handle passing the SchedulerLimits object to compute, yeah? If we can\u0027t send 4.19, then we (1) don\u0027t pass host_list and (2) convert limits to a dict primitive.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9fe837f9fabeed5bf2ed1a709ce8d03e66624534","unresolved":false,"context_lines":[{"line_number":1122,"context_line":"    def build_and_run_instance(self, ctxt, instance, host, image, request_spec,"},{"line_number":1123,"context_line":"            filter_properties, admin_password\u003dNone, injected_files\u003dNone,"},{"line_number":1124,"context_line":"            requested_networks\u003dNone, security_groups\u003dNone,"},{"line_number":1125,"context_line":"            block_device_mapping\u003dNone, node\u003dNone, limits\u003dNone,"},{"line_number":1126,"context_line":"            host_list\u003dNone):"},{"line_number":1127,"context_line":"        kwargs \u003d {\"instance\": instance,"},{"line_number":1128,"context_line":"                  \"image\": image,"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_ac7e9c68","line":1125,"range":{"start_line":1125,"start_character":50,"end_line":1125,"end_character":56},"in_reply_to":"df87a7cf_e6d4cabf","updated":"2017-12-06 20:35:17.000000000","message":"Done","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"}],"nova/conductor/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aaa765f69974f85bd6e2fecc5345483f77e33af","unresolved":false,"context_lines":[{"line_number":113,"context_line":"    def build_instances(self, context, instances, image, filter_properties,"},{"line_number":114,"context_line":"            admin_password, injected_files, requested_networks,"},{"line_number":115,"context_line":"            security_groups, block_device_mapping, legacy_bdm\u003dTrue,"},{"line_number":116,"context_line":"            host_lists\u003dNone):"},{"line_number":117,"context_line":"        self.conductor_compute_rpcapi.build_instances(context,"},{"line_number":118,"context_line":"                instances\u003dinstances, image\u003dimage,"},{"line_number":119,"context_line":"                filter_properties\u003dfilter_properties,"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_0961bfa9","line":116,"range":{"start_line":116,"start_character":12,"end_line":116,"end_character":22},"updated":"2017-12-06 15:25:52.000000000","message":"Why is this host_list for the compute API but host_lists for the conductor API?","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9fe837f9fabeed5bf2ed1a709ce8d03e66624534","unresolved":false,"context_lines":[{"line_number":113,"context_line":"    def build_instances(self, context, instances, image, filter_properties,"},{"line_number":114,"context_line":"            admin_password, injected_files, requested_networks,"},{"line_number":115,"context_line":"            security_groups, block_device_mapping, legacy_bdm\u003dTrue,"},{"line_number":116,"context_line":"            host_lists\u003dNone):"},{"line_number":117,"context_line":"        self.conductor_compute_rpcapi.build_instances(context,"},{"line_number":118,"context_line":"                instances\u003dinstances, image\u003dimage,"},{"line_number":119,"context_line":"                filter_properties\u003dfilter_properties,"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_4c8d9079","line":116,"range":{"start_line":116,"start_character":12,"end_line":116,"end_character":22},"in_reply_to":"df87a7cf_0961bfa9","updated":"2017-12-06 20:35:17.000000000","message":"Again, plural. Conductor can handle multiple instances per call, but on compute it is only concerned with a single instance.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"}],"nova/conductor/manager.py":[{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"c50f3d48f9fcbea4bcfadae782bff4dee105bc09","unresolved":false,"context_lines":[{"line_number":606,"context_line":"                if not claimed:"},{"line_number":607,"context_line":"                    # No more available hosts for retrying the build."},{"line_number":608,"context_line":"                    # TODO(edleafe)"},{"line_number":609,"context_line":"                    # raise SomeException()"},{"line_number":610,"context_line":"                    pass"},{"line_number":611,"context_line":"            instance.availability_zone \u003d ("},{"line_number":612,"context_line":"                availability_zones.get_host_availability_zone(context,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f4e5783_302c2501","line":609,"updated":"2017-10-12 21:25:10.000000000","message":"Looking for some guidance as to how to handle the case where we exhaust all alternates.","commit_id":"86a63047dde7643525235c864b96aa6dcf3082eb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e56c4bf7ccb1091f85ad0a8dee7b33b4932ed00a","unresolved":false,"context_lines":[{"line_number":578,"context_line":"                LOG.info(\"No host supplied for instance\", instance\u003dinstance)"},{"line_number":579,"context_line":"                continue"},{"line_number":580,"context_line":"            host \u003d host_list.pop(0)"},{"line_number":581,"context_line":"            host_ar \u003d host.allocation_request"},{"line_number":582,"context_line":"            if host_ar:"},{"line_number":583,"context_line":"                # Since the allocation_request field is JSON-encoded, an empty"},{"line_number":584,"context_line":"                # value will appear as \u0027null\u0027, so we need to decode it to test"},{"line_number":585,"context_line":"                # for emptiness."},{"line_number":586,"context_line":"                host_ar \u003d jsonutils.loads(host_ar)"},{"line_number":587,"context_line":"            if host_ar:"},{"line_number":588,"context_line":"                # If this run in the superconductor, the first instance will"},{"line_number":589,"context_line":"                # already have its resources claimed in placement, and its"},{"line_number":590,"context_line":"                # \u0027allocation_request\u0027 will be empty. If it is not empty, this"}],"source_content_type":"text/x-python","patch_set":24,"id":"1f485f77_0ffd3fb0","line":587,"range":{"start_line":581,"start_character":12,"end_line":587,"end_character":23},"updated":"2017-11-16 20:15:40.000000000","message":"See https://review.openstack.org/#/c/495854/31/nova/scheduler/filter_scheduler.py@389 - I don\u0027t think this is a good way to be doing this. We should either put an explicit flag in the Selection object per Dan\u0027s point, or filter out Selection objects based on hosts we\u0027ve already tried using filter_properties[\u0027retry\u0027][\u0027hosts\u0027].","commit_id":"d9f5b330e345ba798e65e2b20224689a2db606eb"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"e93b3512ee9e9a4597c5bd862e03748bc8667b41","unresolved":false,"context_lines":[{"line_number":578,"context_line":"                LOG.info(\"No host supplied for instance\", instance\u003dinstance)"},{"line_number":579,"context_line":"                continue"},{"line_number":580,"context_line":"            host \u003d host_list.pop(0)"},{"line_number":581,"context_line":"            host_ar \u003d host.allocation_request"},{"line_number":582,"context_line":"            if host_ar:"},{"line_number":583,"context_line":"                # Since the allocation_request field is JSON-encoded, an empty"},{"line_number":584,"context_line":"                # value will appear as \u0027null\u0027, so we need to decode it to test"},{"line_number":585,"context_line":"                # for emptiness."},{"line_number":586,"context_line":"                host_ar \u003d jsonutils.loads(host_ar)"},{"line_number":587,"context_line":"            if host_ar:"},{"line_number":588,"context_line":"                # If this run in the superconductor, the first instance will"},{"line_number":589,"context_line":"                # already have its resources claimed in placement, and its"},{"line_number":590,"context_line":"                # \u0027allocation_request\u0027 will be empty. If it is not empty, this"}],"source_content_type":"text/x-python","patch_set":24,"id":"1f485f77_dd611dab","line":587,"range":{"start_line":581,"start_character":12,"end_line":587,"end_character":23},"in_reply_to":"1f485f77_0ffd3fb0","updated":"2017-11-16 21:25:32.000000000","message":"I can use the test at L551 to determine if we are in the super or cell conductor, and avoid using the presence of the AR to make that determination.","commit_id":"d9f5b330e345ba798e65e2b20224689a2db606eb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aaa765f69974f85bd6e2fecc5345483f77e33af","unresolved":false,"context_lines":[{"line_number":547,"context_line":"            instance_uuids \u003d [instance.uuid for instance in instances]"},{"line_number":548,"context_line":"            spec_obj \u003d objects.RequestSpec.from_primitives("},{"line_number":549,"context_line":"                    context, request_spec, filter_properties)"},{"line_number":550,"context_line":"            # On a fresh build, `host_lists` will be None. On a retry, though,"},{"line_number":551,"context_line":"            # it will be populated with alternate hosts."},{"line_number":552,"context_line":"            is_retry \u003d host_lists is not None"},{"line_number":553,"context_line":"            if not is_retry:"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_099c5fbe","line":550,"range":{"start_line":550,"start_character":19,"end_line":550,"end_character":30},"updated":"2017-12-06 15:25:52.000000000","message":"\"fresh cellsv1 build\"\n\nThe only time build_instances is called is:\n\n1. From nova-api for cellsv1.\n2. From nova-compute during reschedule. During a reschedule, we should have host_lists.\n\nThere is the caveat that we rescheduled to an older Pike compute that doesn\u0027t support host_list and popped it off, and won\u0027t send it back on reschedule to build_instances. So we should be mindful of that in the comment here.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9fe837f9fabeed5bf2ed1a709ce8d03e66624534","unresolved":false,"context_lines":[{"line_number":547,"context_line":"            instance_uuids \u003d [instance.uuid for instance in instances]"},{"line_number":548,"context_line":"            spec_obj \u003d objects.RequestSpec.from_primitives("},{"line_number":549,"context_line":"                    context, request_spec, filter_properties)"},{"line_number":550,"context_line":"            # On a fresh build, `host_lists` will be None. On a retry, though,"},{"line_number":551,"context_line":"            # it will be populated with alternate hosts."},{"line_number":552,"context_line":"            is_retry \u003d host_lists is not None"},{"line_number":553,"context_line":"            if not is_retry:"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_ac5a1cf0","line":550,"range":{"start_line":550,"start_character":19,"end_line":550,"end_character":30},"in_reply_to":"df87a7cf_099c5fbe","updated":"2017-12-06 20:35:17.000000000","message":"Done","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aaa765f69974f85bd6e2fecc5345483f77e33af","unresolved":false,"context_lines":[{"line_number":548,"context_line":"            spec_obj \u003d objects.RequestSpec.from_primitives("},{"line_number":549,"context_line":"                    context, request_spec, filter_properties)"},{"line_number":550,"context_line":"            # On a fresh build, `host_lists` will be None. On a retry, though,"},{"line_number":551,"context_line":"            # it will be populated with alternate hosts."},{"line_number":552,"context_line":"            is_retry \u003d host_lists is not None"},{"line_number":553,"context_line":"            if not is_retry:"},{"line_number":554,"context_line":"                # If this is a reschedule, we will have received the host_lists"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_0938df9d","line":551,"range":{"start_line":551,"start_character":14,"end_line":551,"end_character":56},"updated":"2017-12-06 15:25:52.000000000","message":"Unless we\u0027re rescheduling from an older compute that doesn\u0027t know about alternate hosts...at that point we\u0027re just done, at least if select_destinations can\u0027t reach the scheduler.\n\nNote that we can determine this scenario if host_lists is None and using the retry information in filter_properties (see scheduler_utils.populate_retry above).","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9fe837f9fabeed5bf2ed1a709ce8d03e66624534","unresolved":false,"context_lines":[{"line_number":548,"context_line":"            spec_obj \u003d objects.RequestSpec.from_primitives("},{"line_number":549,"context_line":"                    context, request_spec, filter_properties)"},{"line_number":550,"context_line":"            # On a fresh build, `host_lists` will be None. On a retry, though,"},{"line_number":551,"context_line":"            # it will be populated with alternate hosts."},{"line_number":552,"context_line":"            is_retry \u003d host_lists is not None"},{"line_number":553,"context_line":"            if not is_retry:"},{"line_number":554,"context_line":"                # If this is a reschedule, we will have received the host_lists"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_2c1ccc10","line":551,"range":{"start_line":551,"start_character":14,"end_line":551,"end_character":56},"in_reply_to":"df87a7cf_0938df9d","updated":"2017-12-06 20:35:17.000000000","message":"When called from an older compute, we will call _schedule_instances() on L557 to get another host; the same behavior that it had in Pike. That doesn\u0027t change. If they exceed max_attempts, the exception will be raised on L545.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aaa765f69974f85bd6e2fecc5345483f77e33af","unresolved":false,"context_lines":[{"line_number":549,"context_line":"                    context, request_spec, filter_properties)"},{"line_number":550,"context_line":"            # On a fresh build, `host_lists` will be None. On a retry, though,"},{"line_number":551,"context_line":"            # it will be populated with alternate hosts."},{"line_number":552,"context_line":"            is_retry \u003d host_lists is not None"},{"line_number":553,"context_line":"            if not is_retry:"},{"line_number":554,"context_line":"                # If this is a reschedule, we will have received the host_lists"},{"line_number":555,"context_line":"                # containing alternates from compute, and don\u0027t need to call"},{"line_number":556,"context_line":"                # _schedule_instances()."},{"line_number":557,"context_line":"                host_lists \u003d self._schedule_instances(context, spec_obj,"},{"line_number":558,"context_line":"                        instance_uuids, return_alternates\u003dTrue)"},{"line_number":559,"context_line":"        except Exception as exc:"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_c90f57df","line":556,"range":{"start_line":552,"start_character":12,"end_line":556,"end_character":40},"updated":"2017-12-06 15:25:52.000000000","message":"As noted above, this isn\u0027t entirely true. We should probably have a private helper method to determine if we\u0027re doing a retry based on (1) the host_lists being None or (2) the filter_properties retry information telling us we\u0027re doing a retry (populate_filter_properties will populate the retry field in filter_properties for the host/node combos that we\u0027ve tried).","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9fe837f9fabeed5bf2ed1a709ce8d03e66624534","unresolved":false,"context_lines":[{"line_number":549,"context_line":"                    context, request_spec, filter_properties)"},{"line_number":550,"context_line":"            # On a fresh build, `host_lists` will be None. On a retry, though,"},{"line_number":551,"context_line":"            # it will be populated with alternate hosts."},{"line_number":552,"context_line":"            is_retry \u003d host_lists is not None"},{"line_number":553,"context_line":"            if not is_retry:"},{"line_number":554,"context_line":"                # If this is a reschedule, we will have received the host_lists"},{"line_number":555,"context_line":"                # containing alternates from compute, and don\u0027t need to call"},{"line_number":556,"context_line":"                # _schedule_instances()."},{"line_number":557,"context_line":"                host_lists \u003d self._schedule_instances(context, spec_obj,"},{"line_number":558,"context_line":"                        instance_uuids, return_alternates\u003dTrue)"},{"line_number":559,"context_line":"        except Exception as exc:"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_ec8a6419","line":556,"range":{"start_line":552,"start_character":12,"end_line":556,"end_character":40},"in_reply_to":"df87a7cf_c90f57df","updated":"2017-12-06 20:35:17.000000000","message":"OK, the comment could be more precise, but I don\u0027t see why that would require a different behavior.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aaa765f69974f85bd6e2fecc5345483f77e33af","unresolved":false,"context_lines":[{"line_number":554,"context_line":"                # If this is a reschedule, we will have received the host_lists"},{"line_number":555,"context_line":"                # containing alternates from compute, and don\u0027t need to call"},{"line_number":556,"context_line":"                # _schedule_instances()."},{"line_number":557,"context_line":"                host_lists \u003d self._schedule_instances(context, spec_obj,"},{"line_number":558,"context_line":"                        instance_uuids, return_alternates\u003dTrue)"},{"line_number":559,"context_line":"        except Exception as exc:"},{"line_number":560,"context_line":"            updates \u003d {\u0027vm_state\u0027: vm_states.ERROR, \u0027task_state\u0027: None}"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_8995cf42","line":557,"updated":"2017-12-06 15:25:52.000000000","message":"Note that even if we rescheduled from an old compute that dropped the alternates, the deployment might be configured that the cell conductor can reach the scheduler as a workaround, so maybe we should still attempt to select_destinations and fail if we can\u0027t, but we wouldn\u0027t want to ask for alternates in that case I don\u0027t think because we\u0027ve basically fallen into the old style reschedule loop at that point. Alternatively we just don\u0027t even attempt it and assume people aren\u0027t going to enable workarounds for reschedules once we have this alternates stuff delivered (even though alternates doesn\u0027t take into account older computes). Probably a discussion point for Dan in the cells v2 meeting.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9fe837f9fabeed5bf2ed1a709ce8d03e66624534","unresolved":false,"context_lines":[{"line_number":554,"context_line":"                # If this is a reschedule, we will have received the host_lists"},{"line_number":555,"context_line":"                # containing alternates from compute, and don\u0027t need to call"},{"line_number":556,"context_line":"                # _schedule_instances()."},{"line_number":557,"context_line":"                host_lists \u003d self._schedule_instances(context, spec_obj,"},{"line_number":558,"context_line":"                        instance_uuids, return_alternates\u003dTrue)"},{"line_number":559,"context_line":"        except Exception as exc:"},{"line_number":560,"context_line":"            updates \u003d {\u0027vm_state\u0027: vm_states.ERROR, \u0027task_state\u0027: None}"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_ccea00ab","line":557,"in_reply_to":"df87a7cf_8995cf42","updated":"2017-12-06 20:35:17.000000000","message":"What will \u0027self.scheduler_client\u0027 be for the cell conductor? Will attempting to call it raise an exception?","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aaa765f69974f85bd6e2fecc5345483f77e33af","unresolved":false,"context_lines":[{"line_number":572,"context_line":"                    context, instance, requested_networks)"},{"line_number":573,"context_line":"            return"},{"line_number":574,"context_line":""},{"line_number":575,"context_line":"        elevated \u003d context.elevated()"},{"line_number":576,"context_line":"        for (instance, host_list) in six.moves.zip(instances, host_lists):"},{"line_number":577,"context_line":"            if not host_list:"},{"line_number":578,"context_line":"                # Something went wrong, as there is no host for the instance."}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_098bff1e","line":575,"updated":"2017-12-06 15:25:52.000000000","message":"Why do we need an elevated context? I guess because that\u0027s the type of context that the FilterScheduler uses when calling claim_resources? I assume that context is elevated for legacy reasons, and we don\u0027t actually need to elevate it here.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aaa765f69974f85bd6e2fecc5345483f77e33af","unresolved":false,"context_lines":[{"line_number":579,"context_line":"                # Log it and move on."},{"line_number":580,"context_line":"                LOG.info(\"No host supplied for instance\", instance\u003dinstance)"},{"line_number":581,"context_line":"                continue"},{"line_number":582,"context_line":"            host \u003d host_list.pop(0)"},{"line_number":583,"context_line":"            if is_retry:"},{"line_number":584,"context_line":"                # If this run in the superconductor, the first instance will"},{"line_number":585,"context_line":"                # already have its resources claimed in placement, and its"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_a9d693c2","line":582,"range":{"start_line":582,"start_character":12,"end_line":582,"end_character":35},"updated":"2017-12-06 15:25:52.000000000","message":"I\u0027m confused, isn\u0027t this the host we just tried to build on and failed (if we\u0027re rescheduling?) - why would we try to claim on that again? Note that we can check this using filter_properties[\u0027retry\u0027][\u0027hosts\u0027] which is a list of [host,node] lists that we\u0027ve tried already.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9fe837f9fabeed5bf2ed1a709ce8d03e66624534","unresolved":false,"context_lines":[{"line_number":579,"context_line":"                # Log it and move on."},{"line_number":580,"context_line":"                LOG.info(\"No host supplied for instance\", instance\u003dinstance)"},{"line_number":581,"context_line":"                continue"},{"line_number":582,"context_line":"            host \u003d host_list.pop(0)"},{"line_number":583,"context_line":"            if is_retry:"},{"line_number":584,"context_line":"                # If this run in the superconductor, the first instance will"},{"line_number":585,"context_line":"                # already have its resources claimed in placement, and its"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_0c2f88f6","line":582,"range":{"start_line":582,"start_character":12,"end_line":582,"end_character":35},"in_reply_to":"df87a7cf_a9d693c2","updated":"2017-12-06 20:35:17.000000000","message":"No, as the host_list is the list of alternates. That\u0027s why when we consider an alternate, we pop it from the list. We\u0027ve already guaranteed that there aren\u0027t duplicates in the list, so the filter_properties check would be redundant.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aaa765f69974f85bd6e2fecc5345483f77e33af","unresolved":false,"context_lines":[{"line_number":582,"context_line":"            host \u003d host_list.pop(0)"},{"line_number":583,"context_line":"            if is_retry:"},{"line_number":584,"context_line":"                # If this run in the superconductor, the first instance will"},{"line_number":585,"context_line":"                # already have its resources claimed in placement, and its"},{"line_number":586,"context_line":"                # \u0027allocation_request\u0027 will be empty. If it is not empty, this"},{"line_number":587,"context_line":"                # is running in the cell conductor, and we need to claim first"},{"line_number":588,"context_line":"                # to ensure that the alternate host still has its resources"},{"line_number":589,"context_line":"                # available."}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_8904ef4b","line":586,"range":{"start_line":585,"start_character":67,"end_line":586,"end_character":53},"updated":"2017-12-06 15:25:52.000000000","message":"Where do we check in this claim flow if the allocation_request is empty in order to ignore it?","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"830bc770a289498fb226ded67547dad144ef7a2a","unresolved":false,"context_lines":[{"line_number":582,"context_line":"            host \u003d host_list.pop(0)"},{"line_number":583,"context_line":"            if is_retry:"},{"line_number":584,"context_line":"                # If this run in the superconductor, the first instance will"},{"line_number":585,"context_line":"                # already have its resources claimed in placement, and its"},{"line_number":586,"context_line":"                # \u0027allocation_request\u0027 will be empty. If it is not empty, this"},{"line_number":587,"context_line":"                # is running in the cell conductor, and we need to claim first"},{"line_number":588,"context_line":"                # to ensure that the alternate host still has its resources"},{"line_number":589,"context_line":"                # available."}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_a909b331","line":586,"range":{"start_line":585,"start_character":67,"end_line":586,"end_character":53},"in_reply_to":"df87a7cf_8904ef4b","updated":"2017-12-06 15:38:07.000000000","message":"BTW, I think this is a bad indicator of what we should be trying. We talked about this a bit before the summit, and Dan\u0027s idea was to put an \u0027allocated\u0027 flag in the Selection object, something like that. My worry here is that we\u0027re making assumptions based on what the scheduler did for the Selection object, so it\u0027s semantic behavior and very tightly coupled. I\u0027m also worried that we\u0027re trying to claim resources on hosts that we\u0027ve already tried to build on, and as noted below, for the primary selected host, the only reason the claim fails is because the scheduler didn\u0027t set any allocation_request on its Selection object. However, the alternate Selection objects WILL have an allocation_request, so let\u0027s say we fail the primary and the first alternative, will we try to claim resources on the first alternative host again before trying the second alternative host?\n\nTo be sane, we likely should pop anything off the Selection list that is also in filter_properties[\u0027retry\u0027][\u0027hosts\u0027] since that\u0027s a definitive list of the hosts we\u0027ve already tried (and failed).","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9fe837f9fabeed5bf2ed1a709ce8d03e66624534","unresolved":false,"context_lines":[{"line_number":582,"context_line":"            host \u003d host_list.pop(0)"},{"line_number":583,"context_line":"            if is_retry:"},{"line_number":584,"context_line":"                # If this run in the superconductor, the first instance will"},{"line_number":585,"context_line":"                # already have its resources claimed in placement, and its"},{"line_number":586,"context_line":"                # \u0027allocation_request\u0027 will be empty. If it is not empty, this"},{"line_number":587,"context_line":"                # is running in the cell conductor, and we need to claim first"},{"line_number":588,"context_line":"                # to ensure that the alternate host still has its resources"},{"line_number":589,"context_line":"                # available."}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_4c1d90bb","line":586,"range":{"start_line":585,"start_character":67,"end_line":586,"end_character":53},"in_reply_to":"df87a7cf_a909b331","updated":"2017-12-06 20:35:17.000000000","message":"That is an old comment. Based on earlier feedback from Dan, I removed that behavior back PS25. I\u0027ll update the comment.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aaa765f69974f85bd6e2fecc5345483f77e33af","unresolved":false,"context_lines":[{"line_number":593,"context_line":"                            self.report_client, spec_obj, instance.uuid,"},{"line_number":594,"context_line":"                            host.allocation_request,"},{"line_number":595,"context_line":"                            host.allocation_request_version)"},{"line_number":596,"context_line":"                    if not claimed:"},{"line_number":597,"context_line":"                        # Insufficient resources remain on that host, so"},{"line_number":598,"context_line":"                        # discard it and try the next."},{"line_number":599,"context_line":"                        host \u003d host_list.pop(0) if host_list else None"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_e9a25b4b","line":596,"range":{"start_line":596,"start_character":20,"end_line":596,"end_character":35},"updated":"2017-12-06 15:25:52.000000000","message":"As noted above, this likely fails the first time because we\u0027re passing None for allocation_request to claim_resources.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9fe837f9fabeed5bf2ed1a709ce8d03e66624534","unresolved":false,"context_lines":[{"line_number":593,"context_line":"                            self.report_client, spec_obj, instance.uuid,"},{"line_number":594,"context_line":"                            host.allocation_request,"},{"line_number":595,"context_line":"                            host.allocation_request_version)"},{"line_number":596,"context_line":"                    if not claimed:"},{"line_number":597,"context_line":"                        # Insufficient resources remain on that host, so"},{"line_number":598,"context_line":"                        # discard it and try the next."},{"line_number":599,"context_line":"                        host \u003d host_list.pop(0) if host_list else None"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_6c8974c8","line":596,"range":{"start_line":596,"start_character":20,"end_line":596,"end_character":35},"in_reply_to":"df87a7cf_e9a25b4b","updated":"2017-12-06 20:35:17.000000000","message":"Again, that behavior changed back in PS25. There are no empty allocation_requests.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aaa765f69974f85bd6e2fecc5345483f77e33af","unresolved":false,"context_lines":[{"line_number":598,"context_line":"                        # discard it and try the next."},{"line_number":599,"context_line":"                        host \u003d host_list.pop(0) if host_list else None"},{"line_number":600,"context_line":"                if not claimed:"},{"line_number":601,"context_line":"                    # No more available hosts for retrying the build."},{"line_number":602,"context_line":"                    max_attempts \u003d CONF.scheduler.max_attempts"},{"line_number":603,"context_line":"                    msg \u003d (_(\u0027Exceeded max scheduling attempts \u0027"},{"line_number":604,"context_line":"                             \u0027%(max_attempts)d for instance \u0027"},{"line_number":605,"context_line":"                             \u0027%(instance_uuid)s.\u0027)"},{"line_number":606,"context_line":"                           % {\u0027max_attempts\u0027: max_attempts,"},{"line_number":607,"context_line":"                              \u0027instance_uuid\u0027: instance.uuid})"},{"line_number":608,"context_line":"                    raise exception.MaxRetriesExceeded(reason\u003dmsg)"},{"line_number":609,"context_line":"            instance.availability_zone \u003d ("},{"line_number":610,"context_line":"                availability_zones.get_host_availability_zone(context,"},{"line_number":611,"context_line":"                        host.service_host))"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_29c283ea","line":608,"range":{"start_line":601,"start_character":20,"end_line":608,"end_character":66},"updated":"2017-12-06 15:25:52.000000000","message":"OK and this is more or less what scheduler_utils.populate_retry does when we\u0027ve hit max attempts, so lgtm.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aaa765f69974f85bd6e2fecc5345483f77e33af","unresolved":false,"context_lines":[{"line_number":1206,"context_line":"                    security_groups\u003dlegacy_secgroups,"},{"line_number":1207,"context_line":"                    block_device_mapping\u003dinstance_bdms,"},{"line_number":1208,"context_line":"                    host\u003dhost.service_host, node\u003dhost.nodename,"},{"line_number":1209,"context_line":"                    limits\u003dlimits, host_list\u003dhost_list)"},{"line_number":1210,"context_line":""},{"line_number":1211,"context_line":"    def _cleanup_build_artifacts(self, context, exc, instances, build_requests,"},{"line_number":1212,"context_line":"                                 request_specs, cell_mapping_cache):"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_49b9072c","line":1209,"range":{"start_line":1209,"start_character":35,"end_line":1209,"end_character":54},"updated":"2017-12-06 15:25:52.000000000","message":"OK so we\u0027re going to send the currently claimed host + alternates to the compute, and the host_list[0] entry is the same host that we\u0027re casting to (host.service_host). We need to be clear about that in RPC API comments and docstrings/comments etc.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9fe837f9fabeed5bf2ed1a709ce8d03e66624534","unresolved":false,"context_lines":[{"line_number":1206,"context_line":"                    security_groups\u003dlegacy_secgroups,"},{"line_number":1207,"context_line":"                    block_device_mapping\u003dinstance_bdms,"},{"line_number":1208,"context_line":"                    host\u003dhost.service_host, node\u003dhost.nodename,"},{"line_number":1209,"context_line":"                    limits\u003dlimits, host_list\u003dhost_list)"},{"line_number":1210,"context_line":""},{"line_number":1211,"context_line":"    def _cleanup_build_artifacts(self, context, exc, instances, build_requests,"},{"line_number":1212,"context_line":"                                 request_specs, cell_mapping_cache):"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_8cadd832","line":1209,"range":{"start_line":1209,"start_character":35,"end_line":1209,"end_character":54},"in_reply_to":"df87a7cf_49b9072c","updated":"2017-12-06 20:35:17.000000000","message":"Remember that the host was popped off of host_list, so they aren\u0027t the same.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7643e85ca38960e51da1ca8c97140e171fc9c359","unresolved":false,"context_lines":[{"line_number":565,"context_line":"                try:"},{"line_number":566,"context_line":"                    # If the BuildRequest stays around then instance show/lists"},{"line_number":567,"context_line":"                    # will pull from it rather than the errored instance."},{"line_number":568,"context_line":"                    self._destroy_build_request(context, instance)"},{"line_number":569,"context_line":"                except exception.BuildRequestNotFound:"},{"line_number":570,"context_line":"                    pass"},{"line_number":571,"context_line":"                self._cleanup_allocated_networks("}],"source_content_type":"text/x-python","patch_set":38,"id":"df87a7cf_f0c38e89","line":568,"updated":"2017-12-12 23:58:58.000000000","message":"It appears we\u0027re hitting this during a reschedule in the ironic multinode job (depends on this patch) and something is blowing up so we\u0027re trying to delete the build request here, which fails because we\u0027re in the cell conductor and can\u0027t reach the API database:\n\nhttp://logs.openstack.org/89/527289/1/check/ironic-tempest-dsvm-ipa-wholedisk-agent_ipmitool-tinyipa-multinode/406d4ab/logs/screen-n-cond-cell1.txt.gz?level\u003dTRACE\n\nBut the question is, why are we hitting this?","commit_id":"01e4c5f0eae9b12b345843c2c2b93e03cdad6c58"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a3279888ed8fbdffde7d099789513568de6098a8","unresolved":false,"context_lines":[{"line_number":1151,"context_line":"            host \u003d host_list[0]"},{"line_number":1152,"context_line":"            alts \u003d [alt.service_host for alt in host_list[1:]]"},{"line_number":1153,"context_line":"            LOG.debug(\"schedule_and_build_instances: Instance: %s; Selected \""},{"line_number":1154,"context_line":"                      \"host: %s; Alternates: %s\", instance, host.service_host,"},{"line_number":1155,"context_line":"                      str(alts))"},{"line_number":1156,"context_line":"            filter_props \u003d request_spec.to_legacy_filter_properties_dict()"},{"line_number":1157,"context_line":"            scheduler_utils.populate_retry(filter_props, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":40,"id":"df87a7cf_e831d55a","line":1154,"range":{"start_line":1154,"start_character":50,"end_line":1154,"end_character":58},"updated":"2017-12-18 21:14:56.000000000","message":"This logs the entire instance:\n\nhttp://logs.openstack.org/89/527289/1/check/ironic-tempest-dsvm-ipa-wholedisk-agent_ipmitool-tinyipa-multinode/22826a2/logs/screen-n-super-cond.txt.gz#_Dec_15_23_17_04_949754\n\nDec 15 23:17:04.949754 ubuntu-xenial-inap-mtl01-0001472200 nova-conductor[20789]: DEBUG nova.conductor.manager [None req-229b8a7d-e226-468c-abe7-b8afa692fc34 tempest-AttachInterfacesTestJSON-368916563 tempest-AttachInterfacesTestJSON-368916563] schedule_and_build_instances: Instance: Instance(access_ip_v4\u003dNone,access_ip_v6\u003dNone,architecture\u003dNone,auto_disk_config\u003dFalse,availability_zone\u003d\u0027nova\u0027,cell_name\u003dNone,cleaned\u003dFalse,config_drive\u003d\u0027\u0027,created_at\u003d2017-12-15T23:17:03Z,default_ephemeral_device\u003dNone,default_swap_device\u003dNone,deleted\u003dFalse,deleted_at\u003dNone,device_metadata\u003dNone,disable_terminate\u003dFalse,display_description\u003d\u0027tempest-AttachInterfacesTestJSON-server-276541043\u0027,display_name\u003d\u0027tempest-AttachInterfacesTestJSON-server-276541043\u0027,ec2_ids\u003dEC2Ids,ephemeral_gb\u003d0,ephemeral_key_uuid\u003dNone,fault\u003d\u003c?\u003e,flavor\u003dFlavor(11),host\u003dNone,hostname\u003d\u0027tempest-attachinterfacestestjson-server-276541043\u0027,id\u003d1,image_ref\u003d\u00272ea91458-f3bd-40a2-a7a0-00fbd0b910be\u0027,info_cache\u003dInstanceInfoCache,instance_type_id\u003d11,kernel_id\u003d\u0027\u0027,key_data\u003dNone,key_name\u003dNone,keypairs\u003dKeyPairList,launch_index\u003d0,launched_at\u003dNone,launched_on\u003dNone,locked\u003dFalse,locked_by\u003dNone,memory_mb\u003d384,metadata\u003d{},migration_context\u003d\u003c?\u003e,new_flavor\u003dNone,node\u003dNone,numa_topology\u003dNone,old_flavor\u003dNone,os_type\u003dNone,pci_devices\u003d\u003c?\u003e,pci_requests\u003dInstancePCIRequests,power_state\u003d0,progress\u003d0,project_id\u003d\u00278803915e4705414dbad4c295a8dc063f\u0027,ramdisk_id\u003d\u0027\u0027,reservation_id\u003d\u0027r-gevfv80v\u0027,root_device_name\u003dNone,root_gb\u003d10,security_groups\u003dSecurityGroupList,services\u003d\u003c?\u003e,shutdown_terminate\u003dFalse,system_metadata\u003d{image_base_image_ref\u003d\u00272ea91458-f3bd-40a2-a7a0-00fbd0b910be\u0027,image_container_format\u003d\u0027bare\u0027,image_disk_format\u003d\u0027qcow2\u0027,image_min_disk\u003d\u002710\u0027,image_min_ram\u003d\u00270\u0027,owner_project_name\u003d\u0027tempest-AttachInterfacesTestJSON-368916563\u0027,owner_user_name\u003d\u0027tempest-AttachInterfacesTestJSON-368916563\u0027},tags\u003d\u003c?\u003e,task_state\u003d\u0027scheduling\u0027,terminated_at\u003dNone,updated_at\u003dNone,user_data\u003dNone,user_id\u003d\u0027be026583edf3469c9fccfecac154dd01\u0027,uuid\u003d0149c34e-3503-4329-8539-9986170e7f1a,vcpu_model\u003dNone,vcpus\u003d1,vm_mode\u003dNone,vm_state\u003d\u0027building\u0027); Selected host: ubuntu-xenial-inap-\nDec 15 23:17:04.950569 ubuntu-xenial-inap-mtl01-0001472200 nova-conductor[20789]: mtl01-0001472200; Alternates: [u\u0027ubuntu-xenial-inap-mtl01-0001472200\u0027, u\u0027ubuntu-xenial-inap-mtl01-0001472200\u0027] {{(pid\u003d21762) schedule_and_build_instances /opt/stack/new/nova/nova/conductor/manager.py:1155}}\n\nHow about we just do this instead:\n\nLOG.debug(\"schedule_and_build_instances: Selected host: %s; Alternates: %s\", host.service_host, alts, instance\u003dinstance)","commit_id":"7396771d24062953c9622a83689d799585694b1b"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"576b860d03570978349d172a2cbe41598f5cd3ed","unresolved":false,"context_lines":[{"line_number":1151,"context_line":"            host \u003d host_list[0]"},{"line_number":1152,"context_line":"            alts \u003d [alt.service_host for alt in host_list[1:]]"},{"line_number":1153,"context_line":"            LOG.debug(\"schedule_and_build_instances: Instance: %s; Selected \""},{"line_number":1154,"context_line":"                      \"host: %s; Alternates: %s\", instance, host.service_host,"},{"line_number":1155,"context_line":"                      str(alts))"},{"line_number":1156,"context_line":"            filter_props \u003d request_spec.to_legacy_filter_properties_dict()"},{"line_number":1157,"context_line":"            scheduler_utils.populate_retry(filter_props, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":40,"id":"df87a7cf_c80bb127","line":1154,"range":{"start_line":1154,"start_character":50,"end_line":1154,"end_character":58},"in_reply_to":"df87a7cf_68a8651f","updated":"2017-12-18 21:30:06.000000000","message":"Done","commit_id":"7396771d24062953c9622a83689d799585694b1b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"30899e2b19bc549e6403f94147825810b0031951","unresolved":false,"context_lines":[{"line_number":1151,"context_line":"            host \u003d host_list[0]"},{"line_number":1152,"context_line":"            alts \u003d [alt.service_host for alt in host_list[1:]]"},{"line_number":1153,"context_line":"            LOG.debug(\"schedule_and_build_instances: Instance: %s; Selected \""},{"line_number":1154,"context_line":"                      \"host: %s; Alternates: %s\", instance, host.service_host,"},{"line_number":1155,"context_line":"                      str(alts))"},{"line_number":1156,"context_line":"            filter_props \u003d request_spec.to_legacy_filter_properties_dict()"},{"line_number":1157,"context_line":"            scheduler_utils.populate_retry(filter_props, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":40,"id":"df87a7cf_68a8651f","line":1154,"range":{"start_line":1154,"start_character":50,"end_line":1154,"end_character":58},"in_reply_to":"df87a7cf_c86ad118","updated":"2017-12-18 21:25:37.000000000","message":"\u003e Hmm, this log shows that we\u0027re getting duplicate alternates:\n \u003e \n \u003e Selected host: ubuntu-xenial-inap-mtl01-0001472200\n \u003e \n \u003e Alternates: [u\u0027ubuntu-xenial-inap-mtl01-0001472200\u0027,\n \u003e u\u0027ubuntu-xenial-inap-mtl01-0001472200\u0027]\n\nWe likely need to log the nodename along with the host, because in this ironic multi-host job, there are 12 nodes spread across 2 distinct compute hosts.","commit_id":"7396771d24062953c9622a83689d799585694b1b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fbb0a0327b3c78b6b5227775d35dce28d608395e","unresolved":false,"context_lines":[{"line_number":1151,"context_line":"            host \u003d host_list[0]"},{"line_number":1152,"context_line":"            alts \u003d [alt.service_host for alt in host_list[1:]]"},{"line_number":1153,"context_line":"            LOG.debug(\"schedule_and_build_instances: Instance: %s; Selected \""},{"line_number":1154,"context_line":"                      \"host: %s; Alternates: %s\", instance, host.service_host,"},{"line_number":1155,"context_line":"                      str(alts))"},{"line_number":1156,"context_line":"            filter_props \u003d request_spec.to_legacy_filter_properties_dict()"},{"line_number":1157,"context_line":"            scheduler_utils.populate_retry(filter_props, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":40,"id":"df87a7cf_c86ad118","line":1154,"range":{"start_line":1154,"start_character":50,"end_line":1154,"end_character":58},"in_reply_to":"df87a7cf_e831d55a","updated":"2017-12-18 21:17:08.000000000","message":"Hmm, this log shows that we\u0027re getting duplicate alternates:\n\nSelected host: ubuntu-xenial-inap-mtl01-0001472200\n\nAlternates: [u\u0027ubuntu-xenial-inap-mtl01-0001472200\u0027, u\u0027ubuntu-xenial-inap-mtl01-0001472200\u0027]","commit_id":"7396771d24062953c9622a83689d799585694b1b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"72ee67e3ceb1081e433619e34740a2c828257fd8","unresolved":false,"context_lines":[{"line_number":1152,"context_line":"            alts \u003d [alt.service_host for alt in host_list[1:]]"},{"line_number":1153,"context_line":"            LOG.debug(\"schedule_and_build_instances: Instance: %s; Selected \""},{"line_number":1154,"context_line":"                      \"host: %s; Alternates: %s\", instance, host.service_host,"},{"line_number":1155,"context_line":"                      str(alts))"},{"line_number":1156,"context_line":"            filter_props \u003d request_spec.to_legacy_filter_properties_dict()"},{"line_number":1157,"context_line":"            scheduler_utils.populate_retry(filter_props, instance.uuid)"},{"line_number":1158,"context_line":"            scheduler_utils.populate_filter_properties(filter_props,"}],"source_content_type":"text/x-python","patch_set":40,"id":"df87a7cf_c892d157","line":1155,"range":{"start_line":1155,"start_character":22,"end_line":1155,"end_character":25},"updated":"2017-12-18 21:06:39.000000000","message":"You don\u0027t have to stringify this, the %s substitution should handle that:\n\n  \u003e\u003e\u003e test \u003d [1,2,3]\n  \u003e\u003e\u003e print \"test: %s\" % test\n  test: [1, 2, 3]\n  \u003e\u003e\u003e","commit_id":"7396771d24062953c9622a83689d799585694b1b"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"576b860d03570978349d172a2cbe41598f5cd3ed","unresolved":false,"context_lines":[{"line_number":1152,"context_line":"            alts \u003d [alt.service_host for alt in host_list[1:]]"},{"line_number":1153,"context_line":"            LOG.debug(\"schedule_and_build_instances: Instance: %s; Selected \""},{"line_number":1154,"context_line":"                      \"host: %s; Alternates: %s\", instance, host.service_host,"},{"line_number":1155,"context_line":"                      str(alts))"},{"line_number":1156,"context_line":"            filter_props \u003d request_spec.to_legacy_filter_properties_dict()"},{"line_number":1157,"context_line":"            scheduler_utils.populate_retry(filter_props, instance.uuid)"},{"line_number":1158,"context_line":"            scheduler_utils.populate_filter_properties(filter_props,"}],"source_content_type":"text/x-python","patch_set":40,"id":"df87a7cf_6804e518","line":1155,"range":{"start_line":1155,"start_character":22,"end_line":1155,"end_character":25},"in_reply_to":"df87a7cf_c892d157","updated":"2017-12-18 21:30:06.000000000","message":"Done","commit_id":"7396771d24062953c9622a83689d799585694b1b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5a9b8871c35f67b30df19872f2a2efabfc0c9f1d","unresolved":false,"context_lines":[{"line_number":542,"context_line":"            # TODO(sbauza): Provide directly the RequestSpec object"},{"line_number":543,"context_line":"            # when populate_retry() accepts it"},{"line_number":544,"context_line":"            request_spec \u003d scheduler_utils.build_request_spec(image, instances)"},{"line_number":545,"context_line":"            scheduler_utils.populate_retry("},{"line_number":546,"context_line":"                filter_properties, instances[0].uuid)"},{"line_number":547,"context_line":"            instance_uuids \u003d [instance.uuid for instance in instances]"},{"line_number":548,"context_line":"            spec_obj \u003d objects.RequestSpec.from_primitives("},{"line_number":549,"context_line":"                    context, request_spec, filter_properties)"}],"source_content_type":"text/x-python","patch_set":41,"id":"df87a7cf_b3d822ef","line":546,"range":{"start_line":545,"start_character":12,"end_line":546,"end_character":53},"updated":"2017-12-18 22:15:37.000000000","message":"This will raise MaxRetriesExceeded if we\u0027ve hit our max_attempts, so my concern on L578 is covered here I think.","commit_id":"3ee3b8379f43aa3570240d69f2718c1003265a0b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"06b11dc7ffbc7147ab56959d5a9a9d8959df213a","unresolved":false,"context_lines":[{"line_number":549,"context_line":"                    context, request_spec, filter_properties)"},{"line_number":550,"context_line":"            # \u0027host_lists\u0027 will be None in one of two cases: when running"},{"line_number":551,"context_line":"            # cellsv1, or during a reschedule from a pre-Queens compute."},{"line_number":552,"context_line":"            is_retry \u003d host_lists is not None"},{"line_number":553,"context_line":"            LOG.debug(\"build_requests retry: %s\", is_retry)"},{"line_number":554,"context_line":"            if not is_retry:"},{"line_number":555,"context_line":"                # If this is a reschedule, we will have received the host_lists"}],"source_content_type":"text/x-python","patch_set":41,"id":"df87a7cf_d3c846a9","line":552,"range":{"start_line":552,"start_character":12,"end_line":552,"end_character":45},"updated":"2017-12-18 21:40:26.000000000","message":"On the last reschedule, wouldn\u0027t host_lists be an empty list?","commit_id":"3ee3b8379f43aa3570240d69f2718c1003265a0b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"01ad0a3918b7fdc3583bc4c1df2fe62e68c03a9c","unresolved":false,"context_lines":[{"line_number":549,"context_line":"                    context, request_spec, filter_properties)"},{"line_number":550,"context_line":"            # \u0027host_lists\u0027 will be None in one of two cases: when running"},{"line_number":551,"context_line":"            # cellsv1, or during a reschedule from a pre-Queens compute."},{"line_number":552,"context_line":"            is_retry \u003d host_lists is not None"},{"line_number":553,"context_line":"            LOG.debug(\"build_requests retry: %s\", is_retry)"},{"line_number":554,"context_line":"            if not is_retry:"},{"line_number":555,"context_line":"                # If this is a reschedule, we will have received the host_lists"}],"source_content_type":"text/x-python","patch_set":41,"id":"df87a7cf_53a99679","line":552,"range":{"start_line":552,"start_character":12,"end_line":552,"end_character":45},"in_reply_to":"df87a7cf_d3c846a9","updated":"2017-12-18 21:58:46.000000000","message":"Ignore this question.","commit_id":"3ee3b8379f43aa3570240d69f2718c1003265a0b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4adfe01eca187c44e6e5986245c0e922314fd2b4","unresolved":false,"context_lines":[{"line_number":550,"context_line":"            # \u0027host_lists\u0027 will be None in one of two cases: when running"},{"line_number":551,"context_line":"            # cellsv1, or during a reschedule from a pre-Queens compute."},{"line_number":552,"context_line":"            is_retry \u003d host_lists is not None"},{"line_number":553,"context_line":"            LOG.debug(\"build_requests retry: %s\", is_retry)"},{"line_number":554,"context_line":"            if not is_retry:"},{"line_number":555,"context_line":"                # If this is a reschedule, we will have received the host_lists"},{"line_number":556,"context_line":"                # containing alternates from compute, and don\u0027t need to call"}],"source_content_type":"text/x-python","patch_set":41,"id":"df87a7cf_1329ce88","line":553,"range":{"start_line":553,"start_character":23,"end_line":553,"end_character":37},"updated":"2017-12-18 21:34:57.000000000","message":"build_instances?","commit_id":"3ee3b8379f43aa3570240d69f2718c1003265a0b"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"6f8d8be64cbf9c454d8f9c5315f45403c024f206","unresolved":false,"context_lines":[{"line_number":550,"context_line":"            # \u0027host_lists\u0027 will be None in one of two cases: when running"},{"line_number":551,"context_line":"            # cellsv1, or during a reschedule from a pre-Queens compute."},{"line_number":552,"context_line":"            is_retry \u003d host_lists is not None"},{"line_number":553,"context_line":"            LOG.debug(\"build_requests retry: %s\", is_retry)"},{"line_number":554,"context_line":"            if not is_retry:"},{"line_number":555,"context_line":"                # If this is a reschedule, we will have received the host_lists"},{"line_number":556,"context_line":"                # containing alternates from compute, and don\u0027t need to call"}],"source_content_type":"text/x-python","patch_set":41,"id":"df87a7cf_b3da6275","line":553,"range":{"start_line":553,"start_character":23,"end_line":553,"end_character":37},"in_reply_to":"df87a7cf_1329ce88","updated":"2017-12-19 16:55:43.000000000","message":"Done","commit_id":"3ee3b8379f43aa3570240d69f2718c1003265a0b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"01ad0a3918b7fdc3583bc4c1df2fe62e68c03a9c","unresolved":false,"context_lines":[{"line_number":575,"context_line":""},{"line_number":576,"context_line":"        elevated \u003d context.elevated()"},{"line_number":577,"context_line":"        for (instance, host_list) in six.moves.zip(instances, host_lists):"},{"line_number":578,"context_line":"            if not host_list:"},{"line_number":579,"context_line":"                # Something went wrong, as there is no host for the instance."},{"line_number":580,"context_line":"                # Log it and move on."},{"line_number":581,"context_line":"                LOG.info(\"No host supplied for instance\", instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":41,"id":"df87a7cf_33be52b4","line":578,"range":{"start_line":578,"start_character":12,"end_line":578,"end_character":29},"updated":"2017-12-18 21:58:46.000000000","message":"Per L599 below, can\u0027t this be True if host_list is empty from a reschedule off our very last alternate? Meaning shouldn\u0027t we fail with MaxRetriesExceeded if host_list is not None but it\u0027s empty?","commit_id":"3ee3b8379f43aa3570240d69f2718c1003265a0b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"06b11dc7ffbc7147ab56959d5a9a9d8959df213a","unresolved":false,"context_lines":[{"line_number":596,"context_line":"                    if not claimed:"},{"line_number":597,"context_line":"                        # Insufficient resources remain on that host, so"},{"line_number":598,"context_line":"                        # discard it and try the next."},{"line_number":599,"context_line":"                        host \u003d host_list.pop(0) if host_list else None"},{"line_number":600,"context_line":"                if not claimed:"},{"line_number":601,"context_line":"                    # No more available hosts for retrying the build."},{"line_number":602,"context_line":"                    max_attempts \u003d CONF.scheduler.max_attempts"}],"source_content_type":"text/x-python","patch_set":41,"id":"df87a7cf_f3cd4ab7","line":599,"range":{"start_line":599,"start_character":31,"end_line":599,"end_character":47},"updated":"2017-12-18 21:40:26.000000000","message":"If this was our last host to try, we\u0027d pop the last entry out of it and now have an empty list. We\u0027d pass that empty list to build_and_run_instance in the compute, which is going to pass it back up to us if we fail, and then L552 will be wrong and we\u0027ll try to hit the scheduler again.","commit_id":"3ee3b8379f43aa3570240d69f2718c1003265a0b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0359754417cc2ccde439dbcc25924782b7239b0c","unresolved":false,"context_lines":[{"line_number":596,"context_line":"                    if not claimed:"},{"line_number":597,"context_line":"                        # Insufficient resources remain on that host, so"},{"line_number":598,"context_line":"                        # discard it and try the next."},{"line_number":599,"context_line":"                        host \u003d host_list.pop(0) if host_list else None"},{"line_number":600,"context_line":"                if not claimed:"},{"line_number":601,"context_line":"                    # No more available hosts for retrying the build."},{"line_number":602,"context_line":"                    max_attempts \u003d CONF.scheduler.max_attempts"}],"source_content_type":"text/x-python","patch_set":41,"id":"df87a7cf_13078e84","line":599,"range":{"start_line":599,"start_character":31,"end_line":599,"end_character":47},"in_reply_to":"df87a7cf_f3cd4ab7","updated":"2017-12-18 22:02:17.000000000","message":"\u003e and then L552 will be wrong and we\u0027ll try to hit the scheduler again.\n\nThat comment is wrong - is_retry will be True as long as host_list is not None, even if it\u0027s empty. But that means we need to handle the case in L578 differently.","commit_id":"3ee3b8379f43aa3570240d69f2718c1003265a0b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4adfe01eca187c44e6e5986245c0e922314fd2b4","unresolved":false,"context_lines":[{"line_number":648,"context_line":""},{"line_number":649,"context_line":"            alts \u003d [(alt.service_host, alt.nodename) for alt in host_list]"},{"line_number":650,"context_line":"            LOG.debug(\"build_instances: Selected host: %s; Alternates: %s\","},{"line_number":651,"context_line":"                    instance.uuid, host.service_host, alts, instance\u003dinstance)"},{"line_number":652,"context_line":""},{"line_number":653,"context_line":"            self.compute_rpcapi.build_and_run_instance(context,"},{"line_number":654,"context_line":"                    instance\u003dinstance, host\u003dhost.service_host, image\u003dimage,"}],"source_content_type":"text/x-python","patch_set":41,"id":"df87a7cf_735dba13","line":651,"range":{"start_line":651,"start_character":35,"end_line":651,"end_character":52},"updated":"2017-12-18 21:34:57.000000000","message":"should probably also log the selected node","commit_id":"3ee3b8379f43aa3570240d69f2718c1003265a0b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4adfe01eca187c44e6e5986245c0e922314fd2b4","unresolved":false,"context_lines":[{"line_number":648,"context_line":""},{"line_number":649,"context_line":"            alts \u003d [(alt.service_host, alt.nodename) for alt in host_list]"},{"line_number":650,"context_line":"            LOG.debug(\"build_instances: Selected host: %s; Alternates: %s\","},{"line_number":651,"context_line":"                    instance.uuid, host.service_host, alts, instance\u003dinstance)"},{"line_number":652,"context_line":""},{"line_number":653,"context_line":"            self.compute_rpcapi.build_and_run_instance(context,"},{"line_number":654,"context_line":"                    instance\u003dinstance, host\u003dhost.service_host, image\u003dimage,"}],"source_content_type":"text/x-python","patch_set":41,"id":"df87a7cf_f3230aa6","line":651,"range":{"start_line":651,"start_character":20,"end_line":651,"end_character":33},"updated":"2017-12-18 21:34:57.000000000","message":"this needs to be removed","commit_id":"3ee3b8379f43aa3570240d69f2718c1003265a0b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4adfe01eca187c44e6e5986245c0e922314fd2b4","unresolved":false,"context_lines":[{"line_number":1148,"context_line":"            # host_list is a list of one or more Selection objects, the first"},{"line_number":1149,"context_line":"            # of which has been selected and its resources claimed."},{"line_number":1150,"context_line":"            host \u003d host_list[0]"},{"line_number":1151,"context_line":"            alts \u003d [alt.service_host for alt in host_list[1:]]"},{"line_number":1152,"context_line":"            LOG.debug(\"schedule_and_build_instances: Instance: %s; Selected \""},{"line_number":1153,"context_line":"                      \"host: %s; Alternates: %s\", instance, host.service_host,"},{"line_number":1154,"context_line":"                      str(alts))"}],"source_content_type":"text/x-python","patch_set":41,"id":"df87a7cf_d36cc6d1","line":1151,"range":{"start_line":1151,"start_character":19,"end_line":1151,"end_character":62},"updated":"2017-12-18 21:34:57.000000000","message":"we should log (host:node) or something because with ironic you can have \u003e1 node per host.","commit_id":"3ee3b8379f43aa3570240d69f2718c1003265a0b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4adfe01eca187c44e6e5986245c0e922314fd2b4","unresolved":false,"context_lines":[{"line_number":1149,"context_line":"            # of which has been selected and its resources claimed."},{"line_number":1150,"context_line":"            host \u003d host_list[0]"},{"line_number":1151,"context_line":"            alts \u003d [alt.service_host for alt in host_list[1:]]"},{"line_number":1152,"context_line":"            LOG.debug(\"schedule_and_build_instances: Instance: %s; Selected \""},{"line_number":1153,"context_line":"                      \"host: %s; Alternates: %s\", instance, host.service_host,"},{"line_number":1154,"context_line":"                      str(alts))"},{"line_number":1155,"context_line":"            filter_props \u003d request_spec.to_legacy_filter_properties_dict()"}],"source_content_type":"text/x-python","patch_set":41,"id":"df87a7cf_3353b219","line":1152,"range":{"start_line":1152,"start_character":23,"end_line":1152,"end_character":51},"updated":"2017-12-18 21:34:57.000000000","message":"this is redundant, it gets logged with the message:\n\nhttp://logs.openstack.org/89/527289/1/check/ironic-tempest-dsvm-ipa-wholedisk-agent_ipmitool-tinyipa-multinode/22826a2/logs/screen-n-super-cond.txt.gz#_Dec_15_23_17_04_949754","commit_id":"3ee3b8379f43aa3570240d69f2718c1003265a0b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4adfe01eca187c44e6e5986245c0e922314fd2b4","unresolved":false,"context_lines":[{"line_number":1150,"context_line":"            host \u003d host_list[0]"},{"line_number":1151,"context_line":"            alts \u003d [alt.service_host for alt in host_list[1:]]"},{"line_number":1152,"context_line":"            LOG.debug(\"schedule_and_build_instances: Instance: %s; Selected \""},{"line_number":1153,"context_line":"                      \"host: %s; Alternates: %s\", instance, host.service_host,"},{"line_number":1154,"context_line":"                      str(alts))"},{"line_number":1155,"context_line":"            filter_props \u003d request_spec.to_legacy_filter_properties_dict()"},{"line_number":1156,"context_line":"            scheduler_utils.populate_retry(filter_props, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":41,"id":"df87a7cf_f371caa9","line":1153,"range":{"start_line":1153,"start_character":60,"end_line":1153,"end_character":77},"updated":"2017-12-18 21:34:57.000000000","message":"how about also logging the selected node? matters for ironic","commit_id":"3ee3b8379f43aa3570240d69f2718c1003265a0b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4adfe01eca187c44e6e5986245c0e922314fd2b4","unresolved":false,"context_lines":[{"line_number":1150,"context_line":"            host \u003d host_list[0]"},{"line_number":1151,"context_line":"            alts \u003d [alt.service_host for alt in host_list[1:]]"},{"line_number":1152,"context_line":"            LOG.debug(\"schedule_and_build_instances: Instance: %s; Selected \""},{"line_number":1153,"context_line":"                      \"host: %s; Alternates: %s\", instance, host.service_host,"},{"line_number":1154,"context_line":"                      str(alts))"},{"line_number":1155,"context_line":"            filter_props \u003d request_spec.to_legacy_filter_properties_dict()"},{"line_number":1156,"context_line":"            scheduler_utils.populate_retry(filter_props, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":41,"id":"df87a7cf_f358ea31","line":1153,"range":{"start_line":1153,"start_character":50,"end_line":1153,"end_character":58},"updated":"2017-12-18 21:34:57.000000000","message":"remove this, use instance\u003dinstance kwarg, we don\u0027t want to log the entire instance object here","commit_id":"3ee3b8379f43aa3570240d69f2718c1003265a0b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4adfe01eca187c44e6e5986245c0e922314fd2b4","unresolved":false,"context_lines":[{"line_number":1151,"context_line":"            alts \u003d [alt.service_host for alt in host_list[1:]]"},{"line_number":1152,"context_line":"            LOG.debug(\"schedule_and_build_instances: Instance: %s; Selected \""},{"line_number":1153,"context_line":"                      \"host: %s; Alternates: %s\", instance, host.service_host,"},{"line_number":1154,"context_line":"                      str(alts))"},{"line_number":1155,"context_line":"            filter_props \u003d request_spec.to_legacy_filter_properties_dict()"},{"line_number":1156,"context_line":"            scheduler_utils.populate_retry(filter_props, instance.uuid)"},{"line_number":1157,"context_line":"            scheduler_utils.populate_filter_properties(filter_props,"}],"source_content_type":"text/x-python","patch_set":41,"id":"df87a7cf_5347564d","line":1154,"range":{"start_line":1154,"start_character":22,"end_line":1154,"end_character":31},"updated":"2017-12-18 21:34:57.000000000","message":"alts","commit_id":"3ee3b8379f43aa3570240d69f2718c1003265a0b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b8ba442c2a54a337541eeecbb6d74abfb58067df","unresolved":false,"context_lines":[{"line_number":542,"context_line":"            # TODO(sbauza): Provide directly the RequestSpec object"},{"line_number":543,"context_line":"            # when populate_retry() accepts it"},{"line_number":544,"context_line":"            request_spec \u003d scheduler_utils.build_request_spec(image, instances)"},{"line_number":545,"context_line":"            scheduler_utils.populate_retry("},{"line_number":546,"context_line":"                filter_properties, instances[0].uuid)"},{"line_number":547,"context_line":"            instance_uuids \u003d [instance.uuid for instance in instances]"},{"line_number":548,"context_line":"            spec_obj \u003d objects.RequestSpec.from_primitives("}],"source_content_type":"text/x-python","patch_set":42,"id":"df87a7cf_b32262b8","line":545,"range":{"start_line":545,"start_character":28,"end_line":545,"end_character":42},"updated":"2017-12-18 22:33:52.000000000","message":"we can\u0027t rely on this because it checks CONF.scheduler.max_attempts, but if we have max_attempts \u003e alternates, we\u0027d still continue even if host_lists is empty.","commit_id":"ffc7c4db6e44361a6b2a370f0697bde09c5f086c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b8ba442c2a54a337541eeecbb6d74abfb58067df","unresolved":false,"context_lines":[{"line_number":551,"context_line":"            # cellsv1, or during a reschedule from a pre-Queens compute."},{"line_number":552,"context_line":"            is_retry \u003d host_lists is not None"},{"line_number":553,"context_line":"            LOG.debug(\"build_requests retry: %s\", is_retry)"},{"line_number":554,"context_line":"            if not is_retry:"},{"line_number":555,"context_line":"                # If this is a reschedule, we will have received the host_lists"},{"line_number":556,"context_line":"                # containing alternates from compute, and don\u0027t need to call"},{"line_number":557,"context_line":"                # _schedule_instances()."}],"source_content_type":"text/x-python","patch_set":42,"id":"df87a7cf_b30b4228","line":554,"range":{"start_line":554,"start_character":12,"end_line":554,"end_character":28},"updated":"2017-12-18 22:33:52.000000000","message":"I suggest adding an elif to this to check if host_lists contains an empty list, meaning we\u0027ve exhausted alternatives.\n\nThe question is, will host_lists[0] be sufficient for that, or would we need to check each entry in the host_lists list because it\u0027s per-instance? If so, then things get ugly and we *do* have to handle this down in the for loop below where you have the check on L578. That might actually be OK, because we just need to raise MaxRetriesExceeded and set the vm state to ERROR.\n\nIf we did it in this code, then we have to avoid trying to delete the build request (because the cell conductor can\u0027t reach the API DB) - which is why we get this:\n\nhttp://logs.openstack.org/89/527289/1/check/ironic-tempest-dsvm-ipa-wholedisk-agent_ipmitool-tinyipa-multinode/406d4ab/logs/screen-n-cond-cell1.txt.gz#_Dec_12_22_23_48_940236","commit_id":"ffc7c4db6e44361a6b2a370f0697bde09c5f086c"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"6f8d8be64cbf9c454d8f9c5315f45403c024f206","unresolved":false,"context_lines":[{"line_number":551,"context_line":"            # cellsv1, or during a reschedule from a pre-Queens compute."},{"line_number":552,"context_line":"            is_retry \u003d host_lists is not None"},{"line_number":553,"context_line":"            LOG.debug(\"build_requests retry: %s\", is_retry)"},{"line_number":554,"context_line":"            if not is_retry:"},{"line_number":555,"context_line":"                # If this is a reschedule, we will have received the host_lists"},{"line_number":556,"context_line":"                # containing alternates from compute, and don\u0027t need to call"},{"line_number":557,"context_line":"                # _schedule_instances()."}],"source_content_type":"text/x-python","patch_set":42,"id":"df87a7cf_ae48b52c","line":554,"range":{"start_line":554,"start_character":12,"end_line":554,"end_character":28},"in_reply_to":"df87a7cf_6e162d4c","updated":"2017-12-19 16:55:43.000000000","message":"Done","commit_id":"ffc7c4db6e44361a6b2a370f0697bde09c5f086c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c0e527dce42117d2dcec97fcc0c4aeac9a3acda0","unresolved":false,"context_lines":[{"line_number":551,"context_line":"            # cellsv1, or during a reschedule from a pre-Queens compute."},{"line_number":552,"context_line":"            is_retry \u003d host_lists is not None"},{"line_number":553,"context_line":"            LOG.debug(\"build_requests retry: %s\", is_retry)"},{"line_number":554,"context_line":"            if not is_retry:"},{"line_number":555,"context_line":"                # If this is a reschedule, we will have received the host_lists"},{"line_number":556,"context_line":"                # containing alternates from compute, and don\u0027t need to call"},{"line_number":557,"context_line":"                # _schedule_instances()."}],"source_content_type":"text/x-python","patch_set":42,"id":"df87a7cf_6e162d4c","line":554,"range":{"start_line":554,"start_character":12,"end_line":554,"end_character":28},"in_reply_to":"df87a7cf_b30b4228","updated":"2017-12-18 22:36:37.000000000","message":"Oh if we\u0027re calling from compute for a reschedule, host_lists will be a single entry, so:\n\n  elif not host_lists[0]:\n\nWould work. You\u0027d still have to avoid deleting the build request in that case however.\n\nCome to think of it, if populate_retry fails with MaxRetriesExceeded, and we try to delete the build request, that\u0027s already broken today. I think that cleanup was really for the NoValidHost case, not reschedules. Likely a latent bug.","commit_id":"ffc7c4db6e44361a6b2a370f0697bde09c5f086c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f378213be230cc0cbeb6f8f58a003a667296088d","unresolved":false,"context_lines":[{"line_number":552,"context_line":"            instance_uuids \u003d [instance.uuid for instance in instances]"},{"line_number":553,"context_line":"            spec_obj \u003d objects.RequestSpec.from_primitives("},{"line_number":554,"context_line":"                    context, request_spec, filter_properties)"},{"line_number":555,"context_line":"            LOG.debug(\"build_requests retry: %s\", is_reschedule)"},{"line_number":556,"context_line":"            if is_reschedule:"},{"line_number":557,"context_line":"                # Make sure that we have a host, as we may have exhausted all"},{"line_number":558,"context_line":"                # our alternates"}],"source_content_type":"text/x-python","patch_set":43,"id":"df87a7cf_c71dcebe","line":555,"range":{"start_line":555,"start_character":23,"end_line":555,"end_character":37},"updated":"2017-12-19 14:11:27.000000000","message":"build_instances? If so, this is redundant since it\u0027s already logged with the message. Maybe reword to something like,\n\n\"Rescheduling? %s\"","commit_id":"ffdeab7a48aa47a8964ecbf82f492dd5391a2a8c"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"6f8d8be64cbf9c454d8f9c5315f45403c024f206","unresolved":false,"context_lines":[{"line_number":552,"context_line":"            instance_uuids \u003d [instance.uuid for instance in instances]"},{"line_number":553,"context_line":"            spec_obj \u003d objects.RequestSpec.from_primitives("},{"line_number":554,"context_line":"                    context, request_spec, filter_properties)"},{"line_number":555,"context_line":"            LOG.debug(\"build_requests retry: %s\", is_reschedule)"},{"line_number":556,"context_line":"            if is_reschedule:"},{"line_number":557,"context_line":"                # Make sure that we have a host, as we may have exhausted all"},{"line_number":558,"context_line":"                # our alternates"}],"source_content_type":"text/x-python","patch_set":43,"id":"df87a7cf_024ba42a","line":555,"range":{"start_line":555,"start_character":23,"end_line":555,"end_character":37},"in_reply_to":"df87a7cf_c71dcebe","updated":"2017-12-19 16:55:43.000000000","message":"Heh, I was just following your comment on https://review.openstack.org/#/c/511358/41/nova/conductor/manager.py@553\n\nRemoved.","commit_id":"ffdeab7a48aa47a8964ecbf82f492dd5391a2a8c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f378213be230cc0cbeb6f8f58a003a667296088d","unresolved":false,"context_lines":[{"line_number":574,"context_line":"                self._set_vm_state_and_notify("},{"line_number":575,"context_line":"                    context, instance.uuid, \u0027build_instances\u0027, updates,"},{"line_number":576,"context_line":"                    exc, request_spec)"},{"line_number":577,"context_line":"                if not is_reschedule:"},{"line_number":578,"context_line":"                    try:"},{"line_number":579,"context_line":"                        # If the BuildRequest stays around then instance"},{"line_number":580,"context_line":"                        # show/lists will pull from it rather than the errored"},{"line_number":581,"context_line":"                        # instance."},{"line_number":582,"context_line":"                        self._destroy_build_request(context, instance)"},{"line_number":583,"context_line":"                    except exception.BuildRequestNotFound:"},{"line_number":584,"context_line":"                        pass"},{"line_number":585,"context_line":"                self._cleanup_allocated_networks("},{"line_number":586,"context_line":"                    context, instance, requested_networks)"},{"line_number":587,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":43,"id":"df87a7cf_a7676a4d","line":584,"range":{"start_line":577,"start_character":16,"end_line":584,"end_character":28},"updated":"2017-12-19 14:11:27.000000000","message":"If we\u0027re happy with this fix:\n\nhttps://review.openstack.org/#/c/528835/\n\nThen you don\u0027t need any changes here and could just rebase on top of that patch.","commit_id":"ffdeab7a48aa47a8964ecbf82f492dd5391a2a8c"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"6f8d8be64cbf9c454d8f9c5315f45403c024f206","unresolved":false,"context_lines":[{"line_number":574,"context_line":"                self._set_vm_state_and_notify("},{"line_number":575,"context_line":"                    context, instance.uuid, \u0027build_instances\u0027, updates,"},{"line_number":576,"context_line":"                    exc, request_spec)"},{"line_number":577,"context_line":"                if not is_reschedule:"},{"line_number":578,"context_line":"                    try:"},{"line_number":579,"context_line":"                        # If the BuildRequest stays around then instance"},{"line_number":580,"context_line":"                        # show/lists will pull from it rather than the errored"},{"line_number":581,"context_line":"                        # instance."},{"line_number":582,"context_line":"                        self._destroy_build_request(context, instance)"},{"line_number":583,"context_line":"                    except exception.BuildRequestNotFound:"},{"line_number":584,"context_line":"                        pass"},{"line_number":585,"context_line":"                self._cleanup_allocated_networks("},{"line_number":586,"context_line":"                    context, instance, requested_networks)"},{"line_number":587,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":43,"id":"df87a7cf_e2dfa063","line":584,"range":{"start_line":577,"start_character":16,"end_line":584,"end_character":28},"in_reply_to":"df87a7cf_a7676a4d","updated":"2017-12-19 16:55:43.000000000","message":"I\u0027m still assuming that with cellsv2 and alternates, the existing retry tracking will eventually go away. But if you think relying on filter_properties to track attempts is ok, then I\u0027ll go with that.","commit_id":"ffdeab7a48aa47a8964ecbf82f492dd5391a2a8c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f378213be230cc0cbeb6f8f58a003a667296088d","unresolved":false,"context_lines":[{"line_number":597,"context_line":"                # has its resources available."},{"line_number":598,"context_line":"                claimed \u003d False"},{"line_number":599,"context_line":"                while host and not claimed:"},{"line_number":600,"context_line":"                    claimed \u003d scheduler_utils.claim_resources(elevated,"},{"line_number":601,"context_line":"                            self.report_client, spec_obj, instance.uuid,"},{"line_number":602,"context_line":"                            host.allocation_request,"},{"line_number":603,"context_line":"                            host.allocation_request_version)"}],"source_content_type":"text/x-python","patch_set":43,"id":"df87a7cf_67364254","line":600,"updated":"2017-12-19 14:11:27.000000000","message":"Functional tests are failing on this:\n\nTraceback (most recent call last):\n  File \"/home/zuul/src/git.openstack.org/openstack/nova/.tox/functional/local/lib/python2.7/site-packages/oslo_messaging/rpc/server.py\", line 163, in _process_incoming\n    res \u003d self.dispatcher.dispatch(message)\n  File \"/home/zuul/src/git.openstack.org/openstack/nova/.tox/functional/local/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py\", line 220, in dispatch\n    return self._do_dispatch(endpoint, method, ctxt, args)\n  File \"/home/zuul/src/git.openstack.org/openstack/nova/.tox/functional/local/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py\", line 190, in _do_dispatch\n    result \u003d func(ctxt, **new_args)\n  File \"nova/conductor/manager.py\", line 603, in build_instances\n    host.allocation_request_version)\n  File \"nova/scheduler/utils.py\", line 800, in claim_resources\n    user_id, allocation_request_version\u003dallocation_request_version)\n  File \"nova/scheduler/client/__init__.py\", line 37, in __run_method\n    return getattr(self.instance, __name)(*args, **kwargs)\n  File \"nova/scheduler/client/report.py\", line 61, in wrapper\n    return f(self, *a, **k)\n  File \"nova/scheduler/client/report.py\", line 110, in wrapper\n    return f(self, *a, **k)\n  File \"nova/scheduler/client/report.py\", line 1126, in claim_resources\n    payload \u003d _move_operation_alloc_request(current_allocs, ar)\n  File \"nova/scheduler/client/report.py\", line 199, in _move_operation_alloc_request\n    for a in dest_alloc_req[\u0027allocations\u0027]) - cur_rp_uuids\nTypeError: string indices must be integers\n\nIt\u0027s failing because it thinks you\u0027re doing a move operation because the instance already has allocations against the first selected host and now we\u0027re trying to claim against a new host.\n\nDon\u0027t we need to remove the allocations for the instance on the previous host before we try to allocate against the next alternate?\n\nThe spec says,\n\n\"If, however, the build fails, compute will call its delete_allocation_for_instance() as it currently does, and then call the ComputeTaskAPI’s build_instances() to perform the retry.\"\n\nI\u0027m not sure where the spec expects compute to call delete_allocation_for_instance() - the resource tracker? Because I don\u0027t think that happens anymore as long as you have all pike+ computes.","commit_id":"ffdeab7a48aa47a8964ecbf82f492dd5391a2a8c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"42a7afaba7ad641df415a96cbff6f1b008e0eb2f","unresolved":false,"context_lines":[{"line_number":597,"context_line":"                # has its resources available."},{"line_number":598,"context_line":"                claimed \u003d False"},{"line_number":599,"context_line":"                while host and not claimed:"},{"line_number":600,"context_line":"                    claimed \u003d scheduler_utils.claim_resources(elevated,"},{"line_number":601,"context_line":"                            self.report_client, spec_obj, instance.uuid,"},{"line_number":602,"context_line":"                            host.allocation_request,"},{"line_number":603,"context_line":"                            host.allocation_request_version)"}],"source_content_type":"text/x-python","patch_set":43,"id":"df87a7cf_e215603e","line":600,"in_reply_to":"df87a7cf_67364254","updated":"2017-12-19 14:15:03.000000000","message":"Heh, also, unrelated, but _move_operation_alloc_request is broken now when we get allocation candidates in the 1.12 format, that\u0027s why we\u0027re getting the TypeError.","commit_id":"ffdeab7a48aa47a8964ecbf82f492dd5391a2a8c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d3960c89bafbe6d304950f1f446cb00e569460ec","unresolved":false,"context_lines":[{"line_number":597,"context_line":"                # has its resources available."},{"line_number":598,"context_line":"                claimed \u003d False"},{"line_number":599,"context_line":"                while host and not claimed:"},{"line_number":600,"context_line":"                    claimed \u003d scheduler_utils.claim_resources(elevated,"},{"line_number":601,"context_line":"                            self.report_client, spec_obj, instance.uuid,"},{"line_number":602,"context_line":"                            host.allocation_request,"},{"line_number":603,"context_line":"                            host.allocation_request_version)"}],"source_content_type":"text/x-python","patch_set":43,"id":"df87a7cf_e2fb20bb","line":600,"in_reply_to":"df87a7cf_e215603e","updated":"2017-12-19 14:32:05.000000000","message":"\u003e Heh, also, unrelated, but _move_operation_alloc_request is broken\n \u003e now when we get allocation candidates in the 1.12 format, that\u0027s\n \u003e why we\u0027re getting the TypeError.\n\nBug 1739042.","commit_id":"ffdeab7a48aa47a8964ecbf82f492dd5391a2a8c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f378213be230cc0cbeb6f8f58a003a667296088d","unresolved":false,"context_lines":[{"line_number":1153,"context_line":"            # host_list is a list of one or more Selection objects, the first"},{"line_number":1154,"context_line":"            # of which has been selected and its resources claimed."},{"line_number":1155,"context_line":"            host \u003d host_list[0]"},{"line_number":1156,"context_line":"            alts \u003d [alt.service_host for alt in host_list[1:]]"},{"line_number":1157,"context_line":"            LOG.debug(\"schedule_and_build_instances: Instance: %s; Selected \""},{"line_number":1158,"context_line":"                      \"host: %s; Alternates: %s\", instance, host.service_host,"},{"line_number":1159,"context_line":"                      str(alts))"}],"source_content_type":"text/x-python","patch_set":43,"id":"df87a7cf_a7368a02","line":1156,"range":{"start_line":1156,"start_character":20,"end_line":1156,"end_character":37},"updated":"2017-12-19 14:11:27.000000000","message":"include node like above","commit_id":"ffdeab7a48aa47a8964ecbf82f492dd5391a2a8c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f378213be230cc0cbeb6f8f58a003a667296088d","unresolved":false,"context_lines":[{"line_number":1154,"context_line":"            # of which has been selected and its resources claimed."},{"line_number":1155,"context_line":"            host \u003d host_list[0]"},{"line_number":1156,"context_line":"            alts \u003d [alt.service_host for alt in host_list[1:]]"},{"line_number":1157,"context_line":"            LOG.debug(\"schedule_and_build_instances: Instance: %s; Selected \""},{"line_number":1158,"context_line":"                      \"host: %s; Alternates: %s\", instance, host.service_host,"},{"line_number":1159,"context_line":"                      str(alts))"},{"line_number":1160,"context_line":"            filter_props \u003d request_spec.to_legacy_filter_properties_dict()"}],"source_content_type":"text/x-python","patch_set":43,"id":"df87a7cf_673c02e1","line":1157,"range":{"start_line":1157,"start_character":23,"end_line":1157,"end_character":51},"updated":"2017-12-19 14:11:27.000000000","message":"This part is redundant.","commit_id":"ffdeab7a48aa47a8964ecbf82f492dd5391a2a8c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f378213be230cc0cbeb6f8f58a003a667296088d","unresolved":false,"context_lines":[{"line_number":1155,"context_line":"            host \u003d host_list[0]"},{"line_number":1156,"context_line":"            alts \u003d [alt.service_host for alt in host_list[1:]]"},{"line_number":1157,"context_line":"            LOG.debug(\"schedule_and_build_instances: Instance: %s; Selected \""},{"line_number":1158,"context_line":"                      \"host: %s; Alternates: %s\", instance, host.service_host,"},{"line_number":1159,"context_line":"                      str(alts))"},{"line_number":1160,"context_line":"            filter_props \u003d request_spec.to_legacy_filter_properties_dict()"},{"line_number":1161,"context_line":"            scheduler_utils.populate_retry(filter_props, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":43,"id":"df87a7cf_47377eff","line":1158,"range":{"start_line":1158,"start_character":50,"end_line":1158,"end_character":58},"updated":"2017-12-19 14:11:27.000000000","message":"don\u0027t log the entire instance","commit_id":"ffdeab7a48aa47a8964ecbf82f492dd5391a2a8c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f378213be230cc0cbeb6f8f58a003a667296088d","unresolved":false,"context_lines":[{"line_number":1155,"context_line":"            host \u003d host_list[0]"},{"line_number":1156,"context_line":"            alts \u003d [alt.service_host for alt in host_list[1:]]"},{"line_number":1157,"context_line":"            LOG.debug(\"schedule_and_build_instances: Instance: %s; Selected \""},{"line_number":1158,"context_line":"                      \"host: %s; Alternates: %s\", instance, host.service_host,"},{"line_number":1159,"context_line":"                      str(alts))"},{"line_number":1160,"context_line":"            filter_props \u003d request_spec.to_legacy_filter_properties_dict()"},{"line_number":1161,"context_line":"            scheduler_utils.populate_retry(filter_props, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":43,"id":"df87a7cf_c72aae8f","line":1158,"range":{"start_line":1158,"start_character":23,"end_line":1158,"end_character":27},"updated":"2017-12-19 14:11:27.000000000","message":"log the selected node as well","commit_id":"ffdeab7a48aa47a8964ecbf82f492dd5391a2a8c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f378213be230cc0cbeb6f8f58a003a667296088d","unresolved":false,"context_lines":[{"line_number":1156,"context_line":"            alts \u003d [alt.service_host for alt in host_list[1:]]"},{"line_number":1157,"context_line":"            LOG.debug(\"schedule_and_build_instances: Instance: %s; Selected \""},{"line_number":1158,"context_line":"                      \"host: %s; Alternates: %s\", instance, host.service_host,"},{"line_number":1159,"context_line":"                      str(alts))"},{"line_number":1160,"context_line":"            filter_props \u003d request_spec.to_legacy_filter_properties_dict()"},{"line_number":1161,"context_line":"            scheduler_utils.populate_retry(filter_props, instance.uuid)"},{"line_number":1162,"context_line":"            scheduler_utils.populate_filter_properties(filter_props,"}],"source_content_type":"text/x-python","patch_set":43,"id":"df87a7cf_8731060e","line":1159,"range":{"start_line":1159,"start_character":22,"end_line":1159,"end_character":31},"updated":"2017-12-19 14:11:27.000000000","message":"alts","commit_id":"ffdeab7a48aa47a8964ecbf82f492dd5391a2a8c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"076e397798bbeabecbac339553a129a154caf17f","unresolved":false,"context_lines":[{"line_number":597,"context_line":"        for (instance, host_list) in six.moves.zip(instances, host_lists):"},{"line_number":598,"context_line":"            host \u003d host_list.pop(0)"},{"line_number":599,"context_line":"            if is_reschedule:"},{"line_number":600,"context_line":"                # If this run in the superconductor, the first instance will"},{"line_number":601,"context_line":"                # already have its resources claimed in placement. If this is a"},{"line_number":602,"context_line":"                # retry, though, this is running in the cell conductor, and we"},{"line_number":603,"context_line":"                # need to claim first to ensure that the alternate host still"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_7d199086","line":600,"range":{"start_line":600,"start_character":26,"end_line":600,"end_character":29},"updated":"2017-12-20 19:50:33.000000000","message":"runs","commit_id":"d3bf281f447a504f4a6f78a8dbdbeb3c62ce6c88"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"84fc6ff599003895fbf893bf070519720ebd9306","unresolved":false,"context_lines":[{"line_number":597,"context_line":"        for (instance, host_list) in six.moves.zip(instances, host_lists):"},{"line_number":598,"context_line":"            host \u003d host_list.pop(0)"},{"line_number":599,"context_line":"            if is_reschedule:"},{"line_number":600,"context_line":"                # If this run in the superconductor, the first instance will"},{"line_number":601,"context_line":"                # already have its resources claimed in placement. If this is a"},{"line_number":602,"context_line":"                # retry, though, this is running in the cell conductor, and we"},{"line_number":603,"context_line":"                # need to claim first to ensure that the alternate host still"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_3bd790c2","line":600,"range":{"start_line":600,"start_character":26,"end_line":600,"end_character":29},"in_reply_to":"bf8cb3f7_7d199086","updated":"2017-12-20 22:15:54.000000000","message":"Done","commit_id":"d3bf281f447a504f4a6f78a8dbdbeb3c62ce6c88"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"076e397798bbeabecbac339553a129a154caf17f","unresolved":false,"context_lines":[{"line_number":607,"context_line":"                    if host.allocation_request:"},{"line_number":608,"context_line":"                        alloc_req \u003d jsonutils.loads(host.allocation_request)"},{"line_number":609,"context_line":"                    else:"},{"line_number":610,"context_line":"                        alloc_req \u003d None"},{"line_number":611,"context_line":"                    claimed \u003d scheduler_utils.claim_resources(elevated,"},{"line_number":612,"context_line":"                            self.report_client, spec_obj, instance.uuid,"},{"line_number":613,"context_line":"                            alloc_req, host.allocation_request_version)"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_e05f370c","line":610,"range":{"start_line":610,"start_character":24,"end_line":610,"end_character":40},"updated":"2017-12-20 19:50:33.000000000","message":"We can\u0027t send this to claim_resources, it would eventually blow up since alloc_req is required in claim_resources.\n\nIn what case would we hit this?\n\nI see two options:\n\n1. Assume that if we\u0027re rescheduling, host.allocation_request is set and we can just deserialize it. If it\u0027s not set, it\u0027s a programming error and we blow up.\n\n2. Check for None and if None, log an ERROR and continue onto the next host (if there is one).","commit_id":"d3bf281f447a504f4a6f78a8dbdbeb3c62ce6c88"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e8c224d08af42947496f3e6dfb913734c990c9b8","unresolved":false,"context_lines":[{"line_number":607,"context_line":"                    if host.allocation_request:"},{"line_number":608,"context_line":"                        alloc_req \u003d jsonutils.loads(host.allocation_request)"},{"line_number":609,"context_line":"                    else:"},{"line_number":610,"context_line":"                        alloc_req \u003d None"},{"line_number":611,"context_line":"                    claimed \u003d scheduler_utils.claim_resources(elevated,"},{"line_number":612,"context_line":"                            self.report_client, spec_obj, instance.uuid,"},{"line_number":613,"context_line":"                            alloc_req, host.allocation_request_version)"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_60600734","line":610,"range":{"start_line":610,"start_character":24,"end_line":610,"end_character":40},"in_reply_to":"bf8cb3f7_e05f370c","updated":"2017-12-20 20:02:22.000000000","message":"Actually, the CachingScheduler doesn\u0027t use Placement, so alternate selections for the CachingScheduler won\u0027t have allocation_request, so we just wouldn\u0027t claim, but it still could be a valid host, right? So no need to log an error in that case, we just only try to claim if the selection object has something to claim with, otherwise we assume the alternate is OK.","commit_id":"d3bf281f447a504f4a6f78a8dbdbeb3c62ce6c88"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"076e397798bbeabecbac339553a129a154caf17f","unresolved":false,"context_lines":[{"line_number":608,"context_line":"                        alloc_req \u003d jsonutils.loads(host.allocation_request)"},{"line_number":609,"context_line":"                    else:"},{"line_number":610,"context_line":"                        alloc_req \u003d None"},{"line_number":611,"context_line":"                    claimed \u003d scheduler_utils.claim_resources(elevated,"},{"line_number":612,"context_line":"                            self.report_client, spec_obj, instance.uuid,"},{"line_number":613,"context_line":"                            alloc_req, host.allocation_request_version)"},{"line_number":614,"context_line":"                    if not claimed:"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_40f2a308","line":611,"updated":"2017-12-20 19:50:33.000000000","message":"So I got looking at this NOTE:\n\nhttps://github.com/openstack/nova/blob/master/nova/scheduler/client/report.py#L1072-L1081\n\nAnd I\u0027m not sure claim_resources is even the thing we want here. This is how we found out that the compute wasn\u0027t deleting the allocations before casting to conductor, and claim_resources was thinking we were doing a move operation because the first host allocations still existed.\n\nWhy wouldn\u0027t we simply call put_allocations here?","commit_id":"d3bf281f447a504f4a6f78a8dbdbeb3c62ce6c88"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"84fc6ff599003895fbf893bf070519720ebd9306","unresolved":false,"context_lines":[{"line_number":608,"context_line":"                        alloc_req \u003d jsonutils.loads(host.allocation_request)"},{"line_number":609,"context_line":"                    else:"},{"line_number":610,"context_line":"                        alloc_req \u003d None"},{"line_number":611,"context_line":"                    claimed \u003d scheduler_utils.claim_resources(elevated,"},{"line_number":612,"context_line":"                            self.report_client, spec_obj, instance.uuid,"},{"line_number":613,"context_line":"                            alloc_req, host.allocation_request_version)"},{"line_number":614,"context_line":"                    if not claimed:"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_bbe160d3","line":611,"in_reply_to":"bf8cb3f7_40f2a308","updated":"2017-12-20 22:15:54.000000000","message":"Well, it\u0027s called because that\u0027s what we\u0027re doing: claiming resources. It has been doing this since before it was moved from the filter_scheduler code over to utils. What seems to have happened is that how this method works was changed to get the move operation stuff working last cycle.\n\nCalling put_allocations() would also require inspecting the allocation_request to determine the resource provider UUID, and that would be another violation of the opacity of the allocation_request.","commit_id":"d3bf281f447a504f4a6f78a8dbdbeb3c62ce6c88"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"076e397798bbeabecbac339553a129a154caf17f","unresolved":false,"context_lines":[{"line_number":1163,"context_line":"            # host_list is a list of one or more Selection objects, the first"},{"line_number":1164,"context_line":"            # of which has been selected and its resources claimed."},{"line_number":1165,"context_line":"            host \u003d host_list.pop(0)"},{"line_number":1166,"context_line":"            alts \u003d [(alt.service_host, alt.nodename) for alt in host_list[1:]]"},{"line_number":1167,"context_line":"            LOG.debug(\"Selected host: %s; Selected node: %s; Alternates: %s\","},{"line_number":1168,"context_line":"                    host.service_host, host.nodename, alts, instance\u003dinstance)"},{"line_number":1169,"context_line":"            filter_props \u003d request_spec.to_legacy_filter_properties_dict()"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_00733b82","line":1166,"range":{"start_line":1166,"start_character":73,"end_line":1166,"end_character":77},"updated":"2017-12-20 19:50:33.000000000","message":"Do you still need this if you popped the first entry off the host_list above?","commit_id":"d3bf281f447a504f4a6f78a8dbdbeb3c62ce6c88"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"84fc6ff599003895fbf893bf070519720ebd9306","unresolved":false,"context_lines":[{"line_number":1163,"context_line":"            # host_list is a list of one or more Selection objects, the first"},{"line_number":1164,"context_line":"            # of which has been selected and its resources claimed."},{"line_number":1165,"context_line":"            host \u003d host_list.pop(0)"},{"line_number":1166,"context_line":"            alts \u003d [(alt.service_host, alt.nodename) for alt in host_list[1:]]"},{"line_number":1167,"context_line":"            LOG.debug(\"Selected host: %s; Selected node: %s; Alternates: %s\","},{"line_number":1168,"context_line":"                    host.service_host, host.nodename, alts, instance\u003dinstance)"},{"line_number":1169,"context_line":"            filter_props \u003d request_spec.to_legacy_filter_properties_dict()"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_76d0cd51","line":1166,"range":{"start_line":1166,"start_character":73,"end_line":1166,"end_character":77},"in_reply_to":"bf8cb3f7_00733b82","updated":"2017-12-20 22:15:54.000000000","message":"Ah, that\u0027s right - now that it\u0027s being popped here, I don\u0027t need it","commit_id":"d3bf281f447a504f4a6f78a8dbdbeb3c62ce6c88"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0c02daa1d26ef7255b60b216a81112410485794f","unresolved":false,"context_lines":[{"line_number":615,"context_line":"                                elevated, self.report_client, spec_obj,"},{"line_number":616,"context_line":"                                instance.uuid, alloc_req,"},{"line_number":617,"context_line":"                                host.allocation_request_version)"},{"line_number":618,"context_line":"                    else:"},{"line_number":619,"context_line":"                        # Some deployments use different schedulers that do not"},{"line_number":620,"context_line":"                        # use Placement, so they will not have an"},{"line_number":621,"context_line":"                        # allocation_request to claim with. For those cases,"},{"line_number":622,"context_line":"                        # there is no concept of claiming, so just assume that"},{"line_number":623,"context_line":"                        # the host is valid."},{"line_number":624,"context_line":"                        host_available \u003d True"},{"line_number":625,"context_line":"                    if not host_available:"},{"line_number":626,"context_line":"                        # Insufficient resources remain on that host, so"},{"line_number":627,"context_line":"                        # discard it and try the next."}],"source_content_type":"text/x-python","patch_set":46,"id":"bf8cb3f7_d851c310","line":624,"range":{"start_line":618,"start_character":20,"end_line":624,"end_character":45},"updated":"2017-12-21 02:17:52.000000000","message":"We should have a unit test for this case. I pulled this change down and raised an exception from this else block and nothing failed.","commit_id":"a4e254ef3af26dac32521fa76ee7156df4f73eb3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"7a7bcdbb6157e743b873deb2e4774b72a2b61971","unresolved":false,"context_lines":[{"line_number":558,"context_line":"                # Make sure that we have a host, as we may have exhausted all"},{"line_number":559,"context_line":"                # our alternates"},{"line_number":560,"context_line":"                if not host_lists[0]:"},{"line_number":561,"context_line":"                    # We have an empty list of hosts, so this instance has"},{"line_number":562,"context_line":"                    # failed to build."},{"line_number":563,"context_line":"                    msg \u003d (\"Exhausted all hosts available for retrying build \""},{"line_number":564,"context_line":"                           \"failures for instance %(instance_uuid)s.\" %"},{"line_number":565,"context_line":"                           {\"instance_uuid\": instances[0].uuid})"},{"line_number":566,"context_line":"                    raise exception.MaxRetriesExceeded(reason\u003dmsg)"},{"line_number":567,"context_line":"            else:"},{"line_number":568,"context_line":"                # This is not a reschedule, so we need to call the scheduler to"},{"line_number":569,"context_line":"                # get appropriate hosts for the request."}],"source_content_type":"text/x-python","patch_set":47,"id":"bf8cb3f7_2be2c9d6","line":566,"range":{"start_line":561,"start_character":20,"end_line":566,"end_character":66},"updated":"2017-12-21 19:01:55.000000000","message":"if host_lists \u003d [], then we won\u0027t get here, because line 560 will throw an IndexError. We will drop down to line 572 and attempt to delete all build requests. Right?","commit_id":"f42f2b2e1f647d1e750c57fba26b70f095549b52"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0ae7887bff2c6752b41327f83039c28c6edb6143","unresolved":false,"context_lines":[{"line_number":558,"context_line":"                # Make sure that we have a host, as we may have exhausted all"},{"line_number":559,"context_line":"                # our alternates"},{"line_number":560,"context_line":"                if not host_lists[0]:"},{"line_number":561,"context_line":"                    # We have an empty list of hosts, so this instance has"},{"line_number":562,"context_line":"                    # failed to build."},{"line_number":563,"context_line":"                    msg \u003d (\"Exhausted all hosts available for retrying build \""},{"line_number":564,"context_line":"                           \"failures for instance %(instance_uuid)s.\" %"},{"line_number":565,"context_line":"                           {\"instance_uuid\": instances[0].uuid})"},{"line_number":566,"context_line":"                    raise exception.MaxRetriesExceeded(reason\u003dmsg)"},{"line_number":567,"context_line":"            else:"},{"line_number":568,"context_line":"                # This is not a reschedule, so we need to call the scheduler to"},{"line_number":569,"context_line":"                # get appropriate hosts for the request."}],"source_content_type":"text/x-python","patch_set":47,"id":"bf8cb3f7_ab5c994b","line":566,"range":{"start_line":561,"start_character":20,"end_line":566,"end_character":66},"in_reply_to":"bf8cb3f7_2bc3a9ef","updated":"2017-12-21 19:15:25.000000000","message":"got it. ok, thanks guys for verifying that.","commit_id":"f42f2b2e1f647d1e750c57fba26b70f095549b52"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"181dea411b660ddc1782a00e1efba7dc46570df6","unresolved":false,"context_lines":[{"line_number":558,"context_line":"                # Make sure that we have a host, as we may have exhausted all"},{"line_number":559,"context_line":"                # our alternates"},{"line_number":560,"context_line":"                if not host_lists[0]:"},{"line_number":561,"context_line":"                    # We have an empty list of hosts, so this instance has"},{"line_number":562,"context_line":"                    # failed to build."},{"line_number":563,"context_line":"                    msg \u003d (\"Exhausted all hosts available for retrying build \""},{"line_number":564,"context_line":"                           \"failures for instance %(instance_uuid)s.\" %"},{"line_number":565,"context_line":"                           {\"instance_uuid\": instances[0].uuid})"},{"line_number":566,"context_line":"                    raise exception.MaxRetriesExceeded(reason\u003dmsg)"},{"line_number":567,"context_line":"            else:"},{"line_number":568,"context_line":"                # This is not a reschedule, so we need to call the scheduler to"},{"line_number":569,"context_line":"                # get appropriate hosts for the request."}],"source_content_type":"text/x-python","patch_set":47,"id":"bf8cb3f7_2bc3a9ef","line":566,"range":{"start_line":561,"start_character":20,"end_line":566,"end_character":66},"in_reply_to":"bf8cb3f7_2be2c9d6","updated":"2017-12-21 19:12:31.000000000","message":"We can come in here in two cases:\n\n1. initial create for cells v1 in which case host_lists is None and is_reschedule will be False so we don\u0027t get here.\n\n2. We\u0027re coming up from compute casting to us, and in that case, the host_list is put into a list:\n\nhttps://review.openstack.org/#/c/511358/47/nova/compute/manager.py@1915\n\nSo this shouldn\u0027t ever be just an empty list. If it\u0027s not None, it has to be a list, which can contain an empty list of it\u0027s own if we\u0027ve exhausted our hosts via popping them off below.","commit_id":"f42f2b2e1f647d1e750c57fba26b70f095549b52"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"d46969a27f6b6bd4e1f553ca5296d75b871b93a1","unresolved":false,"context_lines":[{"line_number":558,"context_line":"                # Make sure that we have a host, as we may have exhausted all"},{"line_number":559,"context_line":"                # our alternates"},{"line_number":560,"context_line":"                if not host_lists[0]:"},{"line_number":561,"context_line":"                    # We have an empty list of hosts, so this instance has"},{"line_number":562,"context_line":"                    # failed to build."},{"line_number":563,"context_line":"                    msg \u003d (\"Exhausted all hosts available for retrying build \""},{"line_number":564,"context_line":"                           \"failures for instance %(instance_uuid)s.\" %"},{"line_number":565,"context_line":"                           {\"instance_uuid\": instances[0].uuid})"},{"line_number":566,"context_line":"                    raise exception.MaxRetriesExceeded(reason\u003dmsg)"},{"line_number":567,"context_line":"            else:"},{"line_number":568,"context_line":"                # This is not a reschedule, so we need to call the scheduler to"},{"line_number":569,"context_line":"                # get appropriate hosts for the request."}],"source_content_type":"text/x-python","patch_set":47,"id":"bf8cb3f7_6bfa1143","line":566,"range":{"start_line":561,"start_character":20,"end_line":566,"end_character":66},"in_reply_to":"bf8cb3f7_2be2c9d6","updated":"2017-12-21 19:10:58.000000000","message":"host_lists is always a list of lists. When it is empty, it will be [[]], so host_lists[0] will be [].","commit_id":"f42f2b2e1f647d1e750c57fba26b70f095549b52"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"7a7bcdbb6157e743b873deb2e4774b72a2b61971","unresolved":false,"context_lines":[{"line_number":673,"context_line":"                    return"},{"line_number":674,"context_line":""},{"line_number":675,"context_line":"            alts \u003d [(alt.service_host, alt.nodename) for alt in host_list]"},{"line_number":676,"context_line":"            LOG.debug(\"Selected host: %s; Selected node: %s; Alternates: %s\","},{"line_number":677,"context_line":"                    host.service_host, host.nodename, alts, instance\u003dinstance)"},{"line_number":678,"context_line":""},{"line_number":679,"context_line":"            self.compute_rpcapi.build_and_run_instance(context,"}],"source_content_type":"text/x-python","patch_set":47,"id":"bf8cb3f7_cbff9d65","line":676,"range":{"start_line":676,"start_character":22,"end_line":676,"end_character":77},"updated":"2017-12-21 19:01:55.000000000","message":"nit: you might want to indicate where in the code this is within the message... so something like:\n\n \"Attempting reschedule of instances. Selected host: %s ...\"","commit_id":"f42f2b2e1f647d1e750c57fba26b70f095549b52"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"d46969a27f6b6bd4e1f553ca5296d75b871b93a1","unresolved":false,"context_lines":[{"line_number":673,"context_line":"                    return"},{"line_number":674,"context_line":""},{"line_number":675,"context_line":"            alts \u003d [(alt.service_host, alt.nodename) for alt in host_list]"},{"line_number":676,"context_line":"            LOG.debug(\"Selected host: %s; Selected node: %s; Alternates: %s\","},{"line_number":677,"context_line":"                    host.service_host, host.nodename, alts, instance\u003dinstance)"},{"line_number":678,"context_line":""},{"line_number":679,"context_line":"            self.compute_rpcapi.build_and_run_instance(context,"}],"source_content_type":"text/x-python","patch_set":47,"id":"bf8cb3f7_8b88b5c6","line":676,"range":{"start_line":676,"start_character":22,"end_line":676,"end_character":77},"in_reply_to":"bf8cb3f7_cbff9d65","updated":"2017-12-21 19:10:58.000000000","message":"Matt pointed out that the debug output already includes the location, and had me remove that.\nhttps://review.openstack.org/#/c/511358/41/nova/conductor/manager.py@1152","commit_id":"f42f2b2e1f647d1e750c57fba26b70f095549b52"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"181dea411b660ddc1782a00e1efba7dc46570df6","unresolved":false,"context_lines":[{"line_number":673,"context_line":"                    return"},{"line_number":674,"context_line":""},{"line_number":675,"context_line":"            alts \u003d [(alt.service_host, alt.nodename) for alt in host_list]"},{"line_number":676,"context_line":"            LOG.debug(\"Selected host: %s; Selected node: %s; Alternates: %s\","},{"line_number":677,"context_line":"                    host.service_host, host.nodename, alts, instance\u003dinstance)"},{"line_number":678,"context_line":""},{"line_number":679,"context_line":"            self.compute_rpcapi.build_and_run_instance(context,"}],"source_content_type":"text/x-python","patch_set":47,"id":"bf8cb3f7_8bb19592","line":676,"range":{"start_line":676,"start_character":22,"end_line":676,"end_character":77},"in_reply_to":"bf8cb3f7_cbff9d65","updated":"2017-12-21 19:12:31.000000000","message":"This gets logged with the context, e.g.:\n\nhttp://logs.openstack.org/58/511358/47/check/legacy-tempest-dsvm-neutron-full/539f670/logs/screen-n-super-cond.txt.gz#_Dec_21_14_40_31_510509\n\nDec 21 14:40:31.510509 ubuntu-xenial-ovh-bhs1-0001558681 nova-conductor[15065]: DEBUG nova.conductor.manager [None req-24e590ce-ce80-49f6-bfb0-d97cccfc22ab tempest-AggregatesAdminTestJSON-955305557 tempest-AggregatesAdminTestJSON-955305557] [instance: 7cb94dc6-8f38-400a-9e98-467f97d74576] Selected host: ubuntu-xenial-ovh-bhs1-0001558681; Selected node: ubuntu-xenial-ovh-bhs1-0001558681; Alternates: [] {{(pid\u003d16057) schedule_and_build_instances /opt/stack/new/nova/nova/conductor/manager.py:1181}}\n\nI know that\u0027s not this method, but shows the method name and line number.","commit_id":"f42f2b2e1f647d1e750c57fba26b70f095549b52"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"7a7bcdbb6157e743b873deb2e4774b72a2b61971","unresolved":false,"context_lines":[{"line_number":1176,"context_line":"            host \u003d host_list.pop(0)"},{"line_number":1177,"context_line":"            alts \u003d [(alt.service_host, alt.nodename) for alt in host_list]"},{"line_number":1178,"context_line":"            LOG.debug(\"Selected host: %s; Selected node: %s; Alternates: %s\","},{"line_number":1179,"context_line":"                    host.service_host, host.nodename, alts, instance\u003dinstance)"},{"line_number":1180,"context_line":"            filter_props \u003d request_spec.to_legacy_filter_properties_dict()"},{"line_number":1181,"context_line":"            scheduler_utils.populate_retry(filter_props, instance.uuid)"},{"line_number":1182,"context_line":"            scheduler_utils.populate_filter_properties(filter_props,"}],"source_content_type":"text/x-python","patch_set":47,"id":"bf8cb3f7_cb0d5d91","line":1179,"updated":"2017-12-21 19:01:55.000000000","message":"similar nit to above. might want to prefix this with:\n\n \"Attempting first build of instance. Selected host: %s ... \"\n\nso that you can differentiate between this LOG message and the one on line 676 that occurs during *rescheduling*.","commit_id":"f42f2b2e1f647d1e750c57fba26b70f095549b52"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"181dea411b660ddc1782a00e1efba7dc46570df6","unresolved":false,"context_lines":[{"line_number":1176,"context_line":"            host \u003d host_list.pop(0)"},{"line_number":1177,"context_line":"            alts \u003d [(alt.service_host, alt.nodename) for alt in host_list]"},{"line_number":1178,"context_line":"            LOG.debug(\"Selected host: %s; Selected node: %s; Alternates: %s\","},{"line_number":1179,"context_line":"                    host.service_host, host.nodename, alts, instance\u003dinstance)"},{"line_number":1180,"context_line":"            filter_props \u003d request_spec.to_legacy_filter_properties_dict()"},{"line_number":1181,"context_line":"            scheduler_utils.populate_retry(filter_props, instance.uuid)"},{"line_number":1182,"context_line":"            scheduler_utils.populate_filter_properties(filter_props,"}],"source_content_type":"text/x-python","patch_set":47,"id":"bf8cb3f7_6ba8d11e","line":1179,"in_reply_to":"bf8cb3f7_cb0d5d91","updated":"2017-12-21 19:12:31.000000000","message":"same","commit_id":"f42f2b2e1f647d1e750c57fba26b70f095549b52"}],"nova/conductor/rpcapi.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aaa765f69974f85bd6e2fecc5345483f77e33af","unresolved":false,"context_lines":[{"line_number":274,"context_line":"    1.15 - Added live_migrate_instance"},{"line_number":275,"context_line":"    1.16 - Added schedule_and_build_instances"},{"line_number":276,"context_line":"    1.17 - Added tags to schedule_and_build_instances()"},{"line_number":277,"context_line":"    1.18 - build_instances() now gets a \u0027host_lists\u0027 parameter that represents"},{"line_number":278,"context_line":"           potential alternate hosts for retries within a cell."},{"line_number":279,"context_line":"    \"\"\""},{"line_number":280,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_4936e7e8","line":277,"updated":"2017-12-06 15:25:52.000000000","message":"Same comments as in the compute rpcapi code - let\u0027s be clear about what this parameter is.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9fe837f9fabeed5bf2ed1a709ce8d03e66624534","unresolved":false,"context_lines":[{"line_number":274,"context_line":"    1.15 - Added live_migrate_instance"},{"line_number":275,"context_line":"    1.16 - Added schedule_and_build_instances"},{"line_number":276,"context_line":"    1.17 - Added tags to schedule_and_build_instances()"},{"line_number":277,"context_line":"    1.18 - build_instances() now gets a \u0027host_lists\u0027 parameter that represents"},{"line_number":278,"context_line":"           potential alternate hosts for retries within a cell."},{"line_number":279,"context_line":"    \"\"\""},{"line_number":280,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_cc49a08b","line":277,"in_reply_to":"df87a7cf_4936e7e8","updated":"2017-12-06 20:35:17.000000000","message":"Done","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"}],"nova/objects/service.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"076e397798bbeabecbac339553a129a154caf17f","unresolved":false,"context_lines":[{"line_number":139,"context_line":"    # Version 1.9: ComputeNode version 1.10"},{"line_number":140,"context_line":"    # Version 1.10: Changes behaviour of loading compute_node"},{"line_number":141,"context_line":"    # Version 1.11: Added get_by_host_and_binary"},{"line_number":142,"context_line":"    # Version 1.12: ComputeNode version 1.11"},{"line_number":143,"context_line":"    # Version 1.13: Added last_seen_up"},{"line_number":144,"context_line":"    # Version 1.14: Added forced_down"},{"line_number":145,"context_line":"    # Version 1.15: ComputeNode version 1.12"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_400e23e6","side":"PARENT","line":142,"updated":"2017-12-20 19:50:33.000000000","message":"Why is this removed?","commit_id":"b04df1bce96139b4ef4cb763f2587438e2cf74aa"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"84fc6ff599003895fbf893bf070519720ebd9306","unresolved":false,"context_lines":[{"line_number":139,"context_line":"    # Version 1.9: ComputeNode version 1.10"},{"line_number":140,"context_line":"    # Version 1.10: Changes behaviour of loading compute_node"},{"line_number":141,"context_line":"    # Version 1.11: Added get_by_host_and_binary"},{"line_number":142,"context_line":"    # Version 1.12: ComputeNode version 1.11"},{"line_number":143,"context_line":"    # Version 1.13: Added last_seen_up"},{"line_number":144,"context_line":"    # Version 1.14: Added forced_down"},{"line_number":145,"context_line":"    # Version 1.15: ComputeNode version 1.12"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_d66c399e","side":"PARENT","line":142,"in_reply_to":"bf8cb3f7_400e23e6","updated":"2017-12-20 22:15:54.000000000","message":"Guess it\u0027s some weird rebase thing. Looks like it happened in PS33.","commit_id":"b04df1bce96139b4ef4cb763f2587438e2cf74aa"}],"nova/scheduler/filter_scheduler.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"076e397798bbeabecbac339553a129a154caf17f","unresolved":false,"context_lines":[{"line_number":345,"context_line":"        selections_to_return \u003d []"},{"line_number":346,"context_line":"        for selected_host in selected_hosts:"},{"line_number":347,"context_line":"            # This is the list of hosts for one particular instance."},{"line_number":348,"context_line":"            if alloc_reqs_by_rp_uuid:"},{"line_number":349,"context_line":"                selected_alloc_req \u003d alloc_reqs_by_rp_uuid.get("},{"line_number":350,"context_line":"                        selected_host.uuid)[0]"},{"line_number":351,"context_line":"            else:"},{"line_number":352,"context_line":"                selected_alloc_req \u003d None"},{"line_number":353,"context_line":"            selection \u003d objects.Selection.from_host_state(selected_host,"},{"line_number":354,"context_line":"                    allocation_request\u003dselected_alloc_req,"},{"line_number":355,"context_line":"                    allocation_request_version\u003dallocation_request_version)"},{"line_number":356,"context_line":"            selected_plus_alts \u003d [selection]"},{"line_number":357,"context_line":"            cell_uuid \u003d selected_host.cell_uuid"},{"line_number":358,"context_line":"            # This will populate the alternates with many of the same unclaimed"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_40270366","line":355,"range":{"start_line":348,"start_character":12,"end_line":355,"end_character":74},"updated":"2017-12-20 19:50:33.000000000","message":"Why is this in this change and not the one that added the rpc parameters to return_alternates?","commit_id":"d3bf281f447a504f4a6f78a8dbdbeb3c62ce6c88"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"84fc6ff599003895fbf893bf070519720ebd9306","unresolved":false,"context_lines":[{"line_number":345,"context_line":"        selections_to_return \u003d []"},{"line_number":346,"context_line":"        for selected_host in selected_hosts:"},{"line_number":347,"context_line":"            # This is the list of hosts for one particular instance."},{"line_number":348,"context_line":"            if alloc_reqs_by_rp_uuid:"},{"line_number":349,"context_line":"                selected_alloc_req \u003d alloc_reqs_by_rp_uuid.get("},{"line_number":350,"context_line":"                        selected_host.uuid)[0]"},{"line_number":351,"context_line":"            else:"},{"line_number":352,"context_line":"                selected_alloc_req \u003d None"},{"line_number":353,"context_line":"            selection \u003d objects.Selection.from_host_state(selected_host,"},{"line_number":354,"context_line":"                    allocation_request\u003dselected_alloc_req,"},{"line_number":355,"context_line":"                    allocation_request_version\u003dallocation_request_version)"},{"line_number":356,"context_line":"            selected_plus_alts \u003d [selection]"},{"line_number":357,"context_line":"            cell_uuid \u003d selected_host.cell_uuid"},{"line_number":358,"context_line":"            # This will populate the alternates with many of the same unclaimed"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_56e6e9ea","line":355,"range":{"start_line":348,"start_character":12,"end_line":355,"end_character":74},"in_reply_to":"bf8cb3f7_40270366","updated":"2017-12-20 22:15:54.000000000","message":"Because it was an oversight. We should always include the allocation request, per discussion on IRC where is was made clear that every Selection object should have its allocation_request field populated, even those for whom resources have already been claimed.","commit_id":"d3bf281f447a504f4a6f78a8dbdbeb3c62ce6c88"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"621c8bab1dfa1ead67ff9bc34df9760a9a815d11","unresolved":false,"context_lines":[{"line_number":345,"context_line":"        selections_to_return \u003d []"},{"line_number":346,"context_line":"        for selected_host in selected_hosts:"},{"line_number":347,"context_line":"            # This is the list of hosts for one particular instance."},{"line_number":348,"context_line":"            if alloc_reqs_by_rp_uuid:"},{"line_number":349,"context_line":"                selected_alloc_req \u003d alloc_reqs_by_rp_uuid.get("},{"line_number":350,"context_line":"                        selected_host.uuid)[0]"},{"line_number":351,"context_line":"            else:"},{"line_number":352,"context_line":"                selected_alloc_req \u003d None"},{"line_number":353,"context_line":"            selection \u003d objects.Selection.from_host_state(selected_host,"},{"line_number":354,"context_line":"                    allocation_request\u003dselected_alloc_req,"},{"line_number":355,"context_line":"                    allocation_request_version\u003dallocation_request_version)"},{"line_number":356,"context_line":"            selected_plus_alts \u003d [selection]"},{"line_number":357,"context_line":"            cell_uuid \u003d selected_host.cell_uuid"},{"line_number":358,"context_line":"            # This will populate the alternates with many of the same unclaimed"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_ecef30ae","line":355,"range":{"start_line":348,"start_character":12,"end_line":355,"end_character":74},"in_reply_to":"bf8cb3f7_56e6e9ea","updated":"2017-12-20 23:31:43.000000000","message":"OK but it\u0027s not necessary in this change right? Can we split it out so it\u0027s own it\u0027s own, unrelated from this series?","commit_id":"d3bf281f447a504f4a6f78a8dbdbeb3c62ce6c88"}],"nova/scheduler/utils.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aaa765f69974f85bd6e2fecc5345483f77e33af","unresolved":false,"context_lines":[{"line_number":777,"context_line":"              \"instance %s\", instance_uuid)"},{"line_number":778,"context_line":""},{"line_number":779,"context_line":"    project_id \u003d spec_obj.project_id"},{"line_number":780,"context_line":""},{"line_number":781,"context_line":"    # NOTE(jaypipes): So, the RequestSpec doesn\u0027t store the user_id,"},{"line_number":782,"context_line":"    # only the project_id, so we need to grab the user information from"},{"line_number":783,"context_line":"    # the context. Perhaps we should consider putting the user ID in"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_e9bb3b6f","side":"PARENT","line":780,"updated":"2017-12-06 15:25:52.000000000","message":"Unrelated change.","commit_id":"9632131b697b95967402163c007d5a17edd9b4c0"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9fe837f9fabeed5bf2ed1a709ce8d03e66624534","unresolved":false,"context_lines":[{"line_number":777,"context_line":"              \"instance %s\", instance_uuid)"},{"line_number":778,"context_line":""},{"line_number":779,"context_line":"    project_id \u003d spec_obj.project_id"},{"line_number":780,"context_line":""},{"line_number":781,"context_line":"    # NOTE(jaypipes): So, the RequestSpec doesn\u0027t store the user_id,"},{"line_number":782,"context_line":"    # only the project_id, so we need to grab the user information from"},{"line_number":783,"context_line":"    # the context. Perhaps we should consider putting the user ID in"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_efbc96dd","side":"PARENT","line":780,"in_reply_to":"df87a7cf_e9bb3b6f","updated":"2017-12-06 20:35:17.000000000","message":"Done","commit_id":"9632131b697b95967402163c007d5a17edd9b4c0"}],"nova/tests/unit/compute/test_rpcapi.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"830bc770a289498fb226ded67547dad144ef7a2a","unresolved":false,"context_lines":[{"line_number":724,"context_line":"                               events\u003d[\u0027event\u0027],"},{"line_number":725,"context_line":"                               version\u003d\u00274.0\u0027)"},{"line_number":726,"context_line":""},{"line_number":727,"context_line":"    def test_build_and_run_instance(self):"},{"line_number":728,"context_line":"        self._test_compute_api(\u0027build_and_run_instance\u0027, \u0027cast\u0027,"},{"line_number":729,"context_line":"                instance\u003dself.fake_instance_obj, host\u003d\u0027host\u0027, image\u003d\u0027image\u0027,"},{"line_number":730,"context_line":"                request_spec\u003d{\u0027request\u0027: \u0027spec\u0027}, filter_properties\u003d[],"},{"line_number":731,"context_line":"                admin_password\u003d\u0027passwd\u0027, injected_files\u003dNone,"},{"line_number":732,"context_line":"                requested_networks\u003d[\u0027network1\u0027], security_groups\u003dNone,"},{"line_number":733,"context_line":"                block_device_mapping\u003dNone, node\u003d\u0027node\u0027, limits\u003d[],"},{"line_number":734,"context_line":"                host_list\u003dNone, version\u003d\u00274.19\u0027)"},{"line_number":735,"context_line":""},{"line_number":736,"context_line":"    def test_quiesce_instance(self):"},{"line_number":737,"context_line":"        self._test_compute_api(\u0027quiesce_instance\u0027, \u0027call\u0027,"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_4c1d9564","line":734,"range":{"start_line":727,"start_character":4,"end_line":734,"end_character":47},"updated":"2017-12-06 15:38:07.000000000","message":"We should have a test where we can\u0027t send 4.19 and make sure the host_list is popped off the kwargs. Don\u0027t try using self._test_compute_api for that, it gets too complicated, just use mock.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9fe837f9fabeed5bf2ed1a709ce8d03e66624534","unresolved":false,"context_lines":[{"line_number":724,"context_line":"                               events\u003d[\u0027event\u0027],"},{"line_number":725,"context_line":"                               version\u003d\u00274.0\u0027)"},{"line_number":726,"context_line":""},{"line_number":727,"context_line":"    def test_build_and_run_instance(self):"},{"line_number":728,"context_line":"        self._test_compute_api(\u0027build_and_run_instance\u0027, \u0027cast\u0027,"},{"line_number":729,"context_line":"                instance\u003dself.fake_instance_obj, host\u003d\u0027host\u0027, image\u003d\u0027image\u0027,"},{"line_number":730,"context_line":"                request_spec\u003d{\u0027request\u0027: \u0027spec\u0027}, filter_properties\u003d[],"},{"line_number":731,"context_line":"                admin_password\u003d\u0027passwd\u0027, injected_files\u003dNone,"},{"line_number":732,"context_line":"                requested_networks\u003d[\u0027network1\u0027], security_groups\u003dNone,"},{"line_number":733,"context_line":"                block_device_mapping\u003dNone, node\u003d\u0027node\u0027, limits\u003d[],"},{"line_number":734,"context_line":"                host_list\u003dNone, version\u003d\u00274.19\u0027)"},{"line_number":735,"context_line":""},{"line_number":736,"context_line":"    def test_quiesce_instance(self):"},{"line_number":737,"context_line":"        self._test_compute_api(\u0027quiesce_instance\u0027, \u0027call\u0027,"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_e206ed86","line":734,"range":{"start_line":727,"start_character":4,"end_line":734,"end_character":47},"in_reply_to":"df87a7cf_4c1d9564","updated":"2017-12-06 20:35:17.000000000","message":"Done","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"}],"nova/tests/unit/conductor/test_conductor.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"830bc770a289498fb226ded67547dad144ef7a2a","unresolved":false,"context_lines":[{"line_number":65,"context_line":"CONF \u003d conf.CONF"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"fake_selection1 \u003d objects.Selection(service_host\u003d\"host1\", nodename\u003d\"node1\","},{"line_number":69,"context_line":"        cell_uuid\u003duuids.cell, limits\u003dNone, allocation_request\u003dNone,"},{"line_number":70,"context_line":"        allocation_request_version\u003dNone)"},{"line_number":71,"context_line":"fake_selection2 \u003d objects.Selection(service_host\u003d\"host2\", nodename\u003d\"node2\","},{"line_number":72,"context_line":"        cell_uuid\u003duuids.cell, limits\u003dNone, allocation_request\u003dNone,"},{"line_number":73,"context_line":"        allocation_request_version\u003dNone)"},{"line_number":74,"context_line":"fake_host_lists1 \u003d [[fake_selection1]]"},{"line_number":75,"context_line":"fake_host_lists2 \u003d [[fake_selection1], [fake_selection2]]"},{"line_number":76,"context_line":"fake_host_lists_alt \u003d [[fake_selection1, fake_selection2]]"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_ac3781e3","line":73,"range":{"start_line":68,"start_character":0,"end_line":73,"end_character":40},"updated":"2017-12-06 15:38:07.000000000","message":"We likely need a primary host and 2 alternates to make testing this very interesting, because I worry about making sure we\u0027re popping off hosts that we\u0027ve already tried properly - we shouldn\u0027t try to claim against a host we\u0027ve already tried to build on.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9fe837f9fabeed5bf2ed1a709ce8d03e66624534","unresolved":false,"context_lines":[{"line_number":65,"context_line":"CONF \u003d conf.CONF"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"fake_selection1 \u003d objects.Selection(service_host\u003d\"host1\", nodename\u003d\"node1\","},{"line_number":69,"context_line":"        cell_uuid\u003duuids.cell, limits\u003dNone, allocation_request\u003dNone,"},{"line_number":70,"context_line":"        allocation_request_version\u003dNone)"},{"line_number":71,"context_line":"fake_selection2 \u003d objects.Selection(service_host\u003d\"host2\", nodename\u003d\"node2\","},{"line_number":72,"context_line":"        cell_uuid\u003duuids.cell, limits\u003dNone, allocation_request\u003dNone,"},{"line_number":73,"context_line":"        allocation_request_version\u003dNone)"},{"line_number":74,"context_line":"fake_host_lists1 \u003d [[fake_selection1]]"},{"line_number":75,"context_line":"fake_host_lists2 \u003d [[fake_selection1], [fake_selection2]]"},{"line_number":76,"context_line":"fake_host_lists_alt \u003d [[fake_selection1, fake_selection2]]"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_4531e3eb","line":73,"range":{"start_line":68,"start_character":0,"end_line":73,"end_character":40},"in_reply_to":"df87a7cf_ac3781e3","updated":"2017-12-06 20:35:17.000000000","message":"ok, I added a third.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"830bc770a289498fb226ded67547dad144ef7a2a","unresolved":false,"context_lines":[{"line_number":696,"context_line":"        select2.allocation_request \u003d jsonutils.dumps(fake_alloc2)"},{"line_number":697,"context_line":"        select1.allocation_request_version \u003d fake_alloc_version"},{"line_number":698,"context_line":"        select2.allocation_request_version \u003d fake_alloc_version"},{"line_number":699,"context_line":"        # A list of two alternate hosts for one instance"},{"line_number":700,"context_line":"        host_lists \u003d [[select1, select2]]"},{"line_number":701,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"},{"line_number":702,"context_line":"        image \u003d {\u0027fake-data\u0027: \u0027should_pass_silently\u0027}"},{"line_number":703,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_8c6abdb0","line":700,"range":{"start_line":699,"start_character":8,"end_line":700,"end_character":41},"updated":"2017-12-06 15:38:07.000000000","message":"Unless I\u0027m missing something, the first reschedule is going to contain the primary host selected during the initial select_destinations call from superconductor, so this is most interesting if we have a primary and 2 alternatives. We shouldn\u0027t try to claim against a selection that we\u0027ve already tried to build on.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9fe837f9fabeed5bf2ed1a709ce8d03e66624534","unresolved":false,"context_lines":[{"line_number":696,"context_line":"        select2.allocation_request \u003d jsonutils.dumps(fake_alloc2)"},{"line_number":697,"context_line":"        select1.allocation_request_version \u003d fake_alloc_version"},{"line_number":698,"context_line":"        select2.allocation_request_version \u003d fake_alloc_version"},{"line_number":699,"context_line":"        # A list of two alternate hosts for one instance"},{"line_number":700,"context_line":"        host_lists \u003d [[select1, select2]]"},{"line_number":701,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"},{"line_number":702,"context_line":"        image \u003d {\u0027fake-data\u0027: \u0027should_pass_silently\u0027}"},{"line_number":703,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_a541cf0d","line":700,"range":{"start_line":699,"start_character":8,"end_line":700,"end_character":41},"in_reply_to":"df87a7cf_8c6abdb0","updated":"2017-12-06 20:35:17.000000000","message":"Ah, I see the issue now. Somewhere in the multiple split/rebase changes, the initial pop of the selected host in schedule_and_build_instances() was lost. I\u0027ll fix that, since the host_list being passed to compute should only be the remaining alternates for that instance.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"830bc770a289498fb226ded67547dad144ef7a2a","unresolved":false,"context_lines":[{"line_number":713,"context_line":"                security_groups\u003d\u0027security_groups\u0027,"},{"line_number":714,"context_line":"                block_device_mapping\u003dNone, legacy_bdm\u003dNone,"},{"line_number":715,"context_line":"                host_lists\u003dhost_lists)"},{"line_number":716,"context_line":"        # Reset the fakes"},{"line_number":717,"context_line":"        select1.allocation_request \u003d None"},{"line_number":718,"context_line":"        select2.allocation_request \u003d None"},{"line_number":719,"context_line":"        select1.allocation_request_version \u003d None"},{"line_number":720,"context_line":"        select2.allocation_request_version \u003d None"},{"line_number":721,"context_line":""},{"line_number":722,"context_line":"    @mock.patch.object(objects.BuildRequest, \u0027get_by_instance_uuid\u0027)"},{"line_number":723,"context_line":"    @mock.patch.object(objects.Instance, \u0027save\u0027)"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_6c465952","line":720,"range":{"start_line":716,"start_character":8,"end_line":720,"end_character":49},"updated":"2017-12-06 15:38:07.000000000","message":"Why is this needed?","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9fe837f9fabeed5bf2ed1a709ce8d03e66624534","unresolved":false,"context_lines":[{"line_number":713,"context_line":"                security_groups\u003d\u0027security_groups\u0027,"},{"line_number":714,"context_line":"                block_device_mapping\u003dNone, legacy_bdm\u003dNone,"},{"line_number":715,"context_line":"                host_lists\u003dhost_lists)"},{"line_number":716,"context_line":"        # Reset the fakes"},{"line_number":717,"context_line":"        select1.allocation_request \u003d None"},{"line_number":718,"context_line":"        select2.allocation_request \u003d None"},{"line_number":719,"context_line":"        select1.allocation_request_version \u003d None"},{"line_number":720,"context_line":"        select2.allocation_request_version \u003d None"},{"line_number":721,"context_line":""},{"line_number":722,"context_line":"    @mock.patch.object(objects.BuildRequest, \u0027get_by_instance_uuid\u0027)"},{"line_number":723,"context_line":"    @mock.patch.object(objects.Instance, \u0027save\u0027)"}],"source_content_type":"text/x-python","patch_set":30,"id":"df87a7cf_a55a2ff0","line":720,"range":{"start_line":716,"start_character":8,"end_line":720,"end_character":49},"in_reply_to":"df87a7cf_6c465952","updated":"2017-12-06 20:35:17.000000000","message":"It isn\u0027t any more, since I added the copy.copy() above. Removed.","commit_id":"76ce40737e53266d19555e4dbc8a646491efe15d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"076e397798bbeabecbac339553a129a154caf17f","unresolved":false,"context_lines":[{"line_number":698,"context_line":""},{"line_number":699,"context_line":"    @mock.patch(\"nova.scheduler.utils.claim_resources\", return_value\u003dFalse)"},{"line_number":700,"context_line":"    @mock.patch.object(objects.Instance, \u0027save\u0027)"},{"line_number":701,"context_line":"    def test_build_instances_exhaust_host_list(self, _mock_save, mock_claim):"},{"line_number":702,"context_line":"        # A list of three alternate hosts for one instance"},{"line_number":703,"context_line":"        host_lists \u003d copy.deepcopy(fake_host_lists_alt)"},{"line_number":704,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_40aaa385","line":701,"range":{"start_line":701,"start_character":65,"end_line":701,"end_character":75},"updated":"2017-12-20 19:50:33.000000000","message":"assert how many times you expect this to be called?","commit_id":"d3bf281f447a504f4a6f78a8dbdbeb3c62ce6c88"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"84fc6ff599003895fbf893bf070519720ebd9306","unresolved":false,"context_lines":[{"line_number":698,"context_line":""},{"line_number":699,"context_line":"    @mock.patch(\"nova.scheduler.utils.claim_resources\", return_value\u003dFalse)"},{"line_number":700,"context_line":"    @mock.patch.object(objects.Instance, \u0027save\u0027)"},{"line_number":701,"context_line":"    def test_build_instances_exhaust_host_list(self, _mock_save, mock_claim):"},{"line_number":702,"context_line":"        # A list of three alternate hosts for one instance"},{"line_number":703,"context_line":"        host_lists \u003d copy.deepcopy(fake_host_lists_alt)"},{"line_number":704,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_d176833f","line":701,"range":{"start_line":701,"start_character":65,"end_line":701,"end_character":75},"in_reply_to":"bf8cb3f7_40aaa385","updated":"2017-12-20 22:15:54.000000000","message":"Done","commit_id":"d3bf281f447a504f4a6f78a8dbdbeb3c62ce6c88"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"076e397798bbeabecbac339553a129a154caf17f","unresolved":false,"context_lines":[{"line_number":704,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"},{"line_number":705,"context_line":"        image \u003d {\u0027fake-data\u0027: \u0027should_pass_silently\u0027}"},{"line_number":706,"context_line":""},{"line_number":707,"context_line":"        # build_instances() is a cast, we need to wait for it to complete"},{"line_number":708,"context_line":"        self.useFixture(cast_as_call.CastAsCall(self))"},{"line_number":709,"context_line":"        # Since claim_resources() is mocked to always return False, we will run"},{"line_number":710,"context_line":"        # out of alternate hosts, and MaxRetriesExceeded should be raised."},{"line_number":711,"context_line":"        self.assertRaises(exc.MaxRetriesExceeded,"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_c0ef93e7","line":708,"range":{"start_line":707,"start_character":8,"end_line":708,"end_character":54},"updated":"2017-12-20 19:50:33.000000000","message":"we\u0027re not actually calling this over rpc in the test are we?\n\noh I guess this is in _BaseTaskTestCase which is mixed into the rpc test, so we\u0027d need it - seems something that should live in the rpc test class setup instead, but could be done later separately.","commit_id":"d3bf281f447a504f4a6f78a8dbdbeb3c62ce6c88"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"84fc6ff599003895fbf893bf070519720ebd9306","unresolved":false,"context_lines":[{"line_number":704,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"},{"line_number":705,"context_line":"        image \u003d {\u0027fake-data\u0027: \u0027should_pass_silently\u0027}"},{"line_number":706,"context_line":""},{"line_number":707,"context_line":"        # build_instances() is a cast, we need to wait for it to complete"},{"line_number":708,"context_line":"        self.useFixture(cast_as_call.CastAsCall(self))"},{"line_number":709,"context_line":"        # Since claim_resources() is mocked to always return False, we will run"},{"line_number":710,"context_line":"        # out of alternate hosts, and MaxRetriesExceeded should be raised."},{"line_number":711,"context_line":"        self.assertRaises(exc.MaxRetriesExceeded,"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_319faf51","line":708,"range":{"start_line":707,"start_character":8,"end_line":708,"end_character":54},"in_reply_to":"bf8cb3f7_c0ef93e7","updated":"2017-12-20 22:15:54.000000000","message":"Especially since it\u0027s used 15 times in this module.","commit_id":"d3bf281f447a504f4a6f78a8dbdbeb3c62ce6c88"}],"nova/tests/unit/objects/test_service.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"076e397798bbeabecbac339553a129a154caf17f","unresolved":false,"context_lines":[{"line_number":470,"context_line":"        self.assertEqual("},{"line_number":471,"context_line":"            current, calculated,"},{"line_number":472,"context_line":"            \u0027Changes detected that require a SERVICE_VERSION change. Please \u0027"},{"line_number":473,"context_line":"            \u0027increment nova.objects.service.SERVICE_VERSION, and make sure it \u0027"},{"line_number":474,"context_line":"            \u0027is equal to nova.compute.manager.ComputeManager.target.version.\u0027)"},{"line_number":475,"context_line":""},{"line_number":476,"context_line":"    def test_version_in_init(self):"}],"source_content_type":"text/x-python","patch_set":45,"id":"bf8cb3f7_6088071f","line":473,"updated":"2017-12-20 19:50:33.000000000","message":"I\u0027m assuming you ran into this during your testing when you didn\u0027t bump the SERVICE_VERSION, so that\u0027s why you\u0027re changing this, albeit unrelated. But OK.","commit_id":"d3bf281f447a504f4a6f78a8dbdbeb3c62ce6c88"}]}
