)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8d641c8411f26d5520da0db589636b411aeef827","unresolved":false,"context_lines":[{"line_number":13,"context_line":"database anyway."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I0b3ec6bb098ca32ffd32a61d4f9dcf426c3faf46"},{"line_number":16,"context_line":"Closes-Bug: #1738876"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"df87a7cf_197a4df0","line":16,"range":{"start_line":16,"start_character":13,"end_line":16,"end_character":20},"updated":"2017-12-19 00:53:38.000000000","message":"wrong bug, should be bug 1733933","commit_id":"430f9db7ca640ae6cbf202b3c2c7cdfb227a744b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e84c837c7610ecb5f5adc16d6b3a79409545eef0","unresolved":false,"context_lines":[{"line_number":13,"context_line":"database anyway."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I0b3ec6bb098ca32ffd32a61d4f9dcf426c3faf46"},{"line_number":16,"context_line":"Closes-Bug: #1738876"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"df87a7cf_59e1b59a","line":16,"range":{"start_line":16,"start_character":13,"end_line":16,"end_character":20},"in_reply_to":"df87a7cf_197a4df0","updated":"2017-12-19 00:58:59.000000000","message":"Also fixes bug 1736946.","commit_id":"430f9db7ca640ae6cbf202b3c2c7cdfb227a744b"}],"nova/conductor/manager.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"704869277d10fe914d4eb20146c1599390cb8741","unresolved":false,"context_lines":[{"line_number":547,"context_line":"                    context, request_spec, filter_properties)"},{"line_number":548,"context_line":"            host_lists \u003d self._schedule_instances(context, spec_obj,"},{"line_number":549,"context_line":"                    instance_uuids, return_alternates\u003dTrue)"},{"line_number":550,"context_line":"        except Exception as exc:"},{"line_number":551,"context_line":"            retries_exceeded \u003d isinstance(exc, exception.MaxRetriesExceeded)"},{"line_number":552,"context_line":"            updates \u003d {\u0027vm_state\u0027: vm_states.ERROR, \u0027task_state\u0027: None}"},{"line_number":553,"context_line":"            for instance in instances:"}],"source_content_type":"text/x-python","patch_set":2,"id":"df87a7cf_88ffe4a9","line":550,"range":{"start_line":550,"start_character":15,"end_line":550,"end_character":24},"updated":"2017-12-19 02:05:25.000000000","message":"If we get here because of NoValidHost, it could be the initial create at the top for cellsv1 in which case we can remove the build request, but if we get NoValidHost due to a reschedule, then we shouldn\u0027t try to delete the build request. We can probably sort this out by checking the num_attempts value in the filter_properties[\u0027retry\u0027] dict. Initial schedule will have num_attempts \u003d 1, so anything after that should be ignored for removing the build request. That\u0027s probably better to check than the specific MaxRetriesExceeded.","commit_id":"2ac74e1accf6f1883910cc801efc1e3c2605fe36"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"54c1c9323e0c26e85be82e856463411f5fee8ed6","unresolved":false,"context_lines":[{"line_number":591,"context_line":"            bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":592,"context_line":"                    context, instance.uuid)"},{"line_number":593,"context_line":""},{"line_number":594,"context_line":"            # This is populated in scheduler_utils.populate_retry"},{"line_number":595,"context_line":"            num_attempts \u003d local_filter_props.get(\u0027retry\u0027,"},{"line_number":596,"context_line":"                                                  {}).get(\u0027num_attempts\u0027, 1)"},{"line_number":597,"context_line":"            if num_attempts \u003c\u003d 1:"},{"line_number":598,"context_line":"                # If this is a reschedule the instance is already mapped to"},{"line_number":599,"context_line":"                # this cell and the BuildRequest is already deleted so ignore"},{"line_number":600,"context_line":"                # the logic below."},{"line_number":601,"context_line":"                inst_mapping \u003d self._populate_instance_mapping(context,"},{"line_number":602,"context_line":"                                                               instance,"},{"line_number":603,"context_line":"                                                               host)"},{"line_number":604,"context_line":"                try:"},{"line_number":605,"context_line":"                    self._destroy_build_request(context, instance)"},{"line_number":606,"context_line":"                except exception.BuildRequestNotFound:"},{"line_number":607,"context_line":"                    # This indicates an instance delete has been requested in"},{"line_number":608,"context_line":"                    # the API. Stop the build, cleanup the instance_mapping and"}],"source_content_type":"text/x-python","patch_set":2,"id":"df87a7cf_48ea3c0f","line":605,"range":{"start_line":594,"start_character":0,"end_line":605,"end_character":66},"updated":"2017-12-19 01:58:28.000000000","message":"Note to reviewers: this is where we delete the build request on an initial schedule to this method (for cellsv1 users).\n\nThe handling above is only for NoValidHost on the initial schedule attempt. If we hit NoValidHost during a reschedule...that\u0027s a different problem.","commit_id":"2ac74e1accf6f1883910cc801efc1e3c2605fe36"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"565696d4f0e523e980124e4772b6dcc656e00d0a","unresolved":false,"context_lines":[{"line_number":549,"context_line":"                    instance_uuids, return_alternates\u003dTrue)"},{"line_number":550,"context_line":"        except Exception as exc:"},{"line_number":551,"context_line":"            num_attempts \u003d filter_properties.get("},{"line_number":552,"context_line":"                \u0027retry\u0027, {}).get(\u0027num_attempts\u0027, 1)"},{"line_number":553,"context_line":"            updates \u003d {\u0027vm_state\u0027: vm_states.ERROR, \u0027task_state\u0027: None}"},{"line_number":554,"context_line":"            for instance in instances:"},{"line_number":555,"context_line":"                self._set_vm_state_and_notify("}],"source_content_type":"text/x-python","patch_set":3,"id":"df87a7cf_c21dbcbe","line":552,"updated":"2017-12-19 15:05:23.000000000","message":"Fine with me, it means that if the operator doesn\u0027t support retries, we still try to destroy the BuildRequest record.","commit_id":"b04df1bce96139b4ef4cb763f2587438e2cf74aa"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"7c4f454e2be6df4bf919021dc10112a33f92956a","unresolved":false,"context_lines":[{"line_number":549,"context_line":"                    instance_uuids, return_alternates\u003dTrue)"},{"line_number":550,"context_line":"        except Exception as exc:"},{"line_number":551,"context_line":"            num_attempts \u003d filter_properties.get("},{"line_number":552,"context_line":"                \u0027retry\u0027, {}).get(\u0027num_attempts\u0027, 1)"},{"line_number":553,"context_line":"            updates \u003d {\u0027vm_state\u0027: vm_states.ERROR, \u0027task_state\u0027: None}"},{"line_number":554,"context_line":"            for instance in instances:"},{"line_number":555,"context_line":"                self._set_vm_state_and_notify("}],"source_content_type":"text/x-python","patch_set":3,"id":"df87a7cf_c1285087","line":552,"in_reply_to":"df87a7cf_5984425e","updated":"2017-12-19 22:49:02.000000000","message":"Still think that we only need to check if we are in a reschedule, as in https://review.openstack.org/#/c/511358/43/nova/conductor/manager.py@577, but this will work too.","commit_id":"b04df1bce96139b4ef4cb763f2587438e2cf74aa"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cd68d5790f01c4629d1180aee74db41014542857","unresolved":false,"context_lines":[{"line_number":549,"context_line":"                    instance_uuids, return_alternates\u003dTrue)"},{"line_number":550,"context_line":"        except Exception as exc:"},{"line_number":551,"context_line":"            num_attempts \u003d filter_properties.get("},{"line_number":552,"context_line":"                \u0027retry\u0027, {}).get(\u0027num_attempts\u0027, 1)"},{"line_number":553,"context_line":"            updates \u003d {\u0027vm_state\u0027: vm_states.ERROR, \u0027task_state\u0027: None}"},{"line_number":554,"context_line":"            for instance in instances:"},{"line_number":555,"context_line":"                self._set_vm_state_and_notify("}],"source_content_type":"text/x-python","patch_set":3,"id":"bf8cb3f7_4b070d1e","line":552,"in_reply_to":"df87a7cf_c1285087","updated":"2017-12-21 19:18:31.000000000","message":"I\u0027m going to backport this fix so don\u0027t really want to rely on code that will only exist in master.","commit_id":"b04df1bce96139b4ef4cb763f2587438e2cf74aa"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"344cee8399e002a3c8d8c673629d50cda57a6333","unresolved":false,"context_lines":[{"line_number":549,"context_line":"                    instance_uuids, return_alternates\u003dTrue)"},{"line_number":550,"context_line":"        except Exception as exc:"},{"line_number":551,"context_line":"            num_attempts \u003d filter_properties.get("},{"line_number":552,"context_line":"                \u0027retry\u0027, {}).get(\u0027num_attempts\u0027, 1)"},{"line_number":553,"context_line":"            updates \u003d {\u0027vm_state\u0027: vm_states.ERROR, \u0027task_state\u0027: None}"},{"line_number":554,"context_line":"            for instance in instances:"},{"line_number":555,"context_line":"                self._set_vm_state_and_notify("}],"source_content_type":"text/x-python","patch_set":3,"id":"df87a7cf_5984425e","line":552,"in_reply_to":"df87a7cf_c21dbcbe","updated":"2017-12-19 15:46:05.000000000","message":"If the operator doesn\u0027t support retries, we don\u0027t get this far because the compute won\u0027t cast back to conductor:\n\nhttps://github.com/openstack/nova/blob/cd57105effc8f0807884e92d4a2a45273873c9a3/nova/compute/manager.py#L1856\n\nBut if we got *that* far to the compute, we already deleted the build request below.","commit_id":"b04df1bce96139b4ef4cb763f2587438e2cf74aa"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"565696d4f0e523e980124e4772b6dcc656e00d0a","unresolved":false,"context_lines":[{"line_number":559,"context_line":"                # either hit NoValidHost or MaxRetriesExceeded. Either way,"},{"line_number":560,"context_line":"                # the build request should already be gone and we probably"},{"line_number":561,"context_line":"                # can\u0027t reach the API DB from the cell conductor."},{"line_number":562,"context_line":"                if num_attempts \u003c\u003d 1:"},{"line_number":563,"context_line":"                    try:"},{"line_number":564,"context_line":"                        # If the BuildRequest stays around then instance"},{"line_number":565,"context_line":"                        # show/lists will pull from it rather than the errored"}],"source_content_type":"text/x-python","patch_set":3,"id":"df87a7cf_02040449","line":562,"updated":"2017-12-19 15:05:23.000000000","message":"TBC, that means we only try to delete now if :\n- either the operator only accepts max_attempts\u003d1 (which disables retries)\n- or we only delete at the first attempt in case of a NoValidHost raised by the scheduler\n\nIf we get a NoValidHost at a second attempt from the scheduler, or if populate_retry() raises MaxRetriesExceeded (meaning that we have more than one attempt), then we don\u0027t try to delete the BuildRequest.\n\nActually, if the first attempt was OK from a scheduler point, the conductor should have already removed the BuildRequest record so we should be good.","commit_id":"b04df1bce96139b4ef4cb763f2587438e2cf74aa"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"344cee8399e002a3c8d8c673629d50cda57a6333","unresolved":false,"context_lines":[{"line_number":559,"context_line":"                # either hit NoValidHost or MaxRetriesExceeded. Either way,"},{"line_number":560,"context_line":"                # the build request should already be gone and we probably"},{"line_number":561,"context_line":"                # can\u0027t reach the API DB from the cell conductor."},{"line_number":562,"context_line":"                if num_attempts \u003c\u003d 1:"},{"line_number":563,"context_line":"                    try:"},{"line_number":564,"context_line":"                        # If the BuildRequest stays around then instance"},{"line_number":565,"context_line":"                        # show/lists will pull from it rather than the errored"}],"source_content_type":"text/x-python","patch_set":3,"id":"df87a7cf_f994368d","line":562,"in_reply_to":"df87a7cf_02040449","updated":"2017-12-19 15:46:05.000000000","message":"\u003e Actually, if the first attempt was OK from a scheduler point, the conductor should have already removed the BuildRequest record so we should be good.\n\nCorrect, that\u0027s what I tried to reply with above. It gets hard to keep the flows all straight in my head.","commit_id":"b04df1bce96139b4ef4cb763f2587438e2cf74aa"}],"nova/tests/unit/conductor/test_conductor.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"565696d4f0e523e980124e4772b6dcc656e00d0a","unresolved":false,"context_lines":[{"line_number":2492,"context_line":"        }"},{"line_number":2493,"context_line":"        requested_networks \u003d objects.NetworkRequestList()"},{"line_number":2494,"context_line":"        with mock.patch.object(self.conductor, \u0027_destroy_build_request\u0027,"},{"line_number":2495,"context_line":"                               new_callable\u003dmock.NonCallableMock):"},{"line_number":2496,"context_line":"            self.conductor.build_instances("},{"line_number":2497,"context_line":"                self.context, [instance], image, filter_props,"},{"line_number":2498,"context_line":"                mock.sentinel.admin_pass, mock.sentinel.files,"}],"source_content_type":"text/x-python","patch_set":3,"id":"df87a7cf_567651a6","line":2495,"range":{"start_line":2495,"start_character":44,"end_line":2495,"end_character":64},"updated":"2017-12-19 15:05:23.000000000","message":"gtk, it means that if we call the mock, we get an exception. Nice.","commit_id":"b04df1bce96139b4ef4cb763f2587438e2cf74aa"}]}
