)]}'
{"neutron/services/segments/plugin.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"196cf9d5c1d068c59e0c94508ae5829eb1189af3","unresolved":false,"context_lines":[{"line_number":386,"context_line":"        try:"},{"line_number":387,"context_line":"            self.p_client.delete_resource_provider(event.segment_id)"},{"line_number":388,"context_line":"        except placement_exc.PlacementClientError:"},{"line_number":389,"context_line":"            LOG.info(\u0027Segment %s resource provider not found\u0027,"},{"line_number":390,"context_line":"                     event.segment_id)"},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"    @registry.receives(resources.SEGMENT_HOST_MAPPING, [events.AFTER_CREATE])"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_6d96ba40","line":389,"range":{"start_line":389,"start_character":51,"end_line":389,"end_character":60},"updated":"2020-05-18 15:12:40.000000000","message":"Does PlacementClientError always mean \u0027not found\u0027?","commit_id":"c7020897201a4cc59c7d1cb10e7647810188969b"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"2191840e6b16f35e536af0b2337abbd547bc4451","unresolved":false,"context_lines":[{"line_number":386,"context_line":"        try:"},{"line_number":387,"context_line":"            self.p_client.delete_resource_provider(event.segment_id)"},{"line_number":388,"context_line":"        except placement_exc.PlacementClientError:"},{"line_number":389,"context_line":"            LOG.info(\u0027Segment %s resource provider not found\u0027,"},{"line_number":390,"context_line":"                     event.segment_id)"},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"    @registry.receives(resources.SEGMENT_HOST_MAPPING, [events.AFTER_CREATE])"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_b10bfd7a","line":389,"range":{"start_line":389,"start_character":51,"end_line":389,"end_character":60},"in_reply_to":"ff570b3c_411bbd7f","updated":"2020-05-19 10:19:21.000000000","message":"If the response code is between 400 and 499, see:\nhttps://opendev.org/openstack/neutron-lib/src/branch/master/neutron_lib/placement/client.py#L57-L67\n\nWe had the same problem for bandwidth service plugin, and Bence (rubasov) spent a lot of time to workaround that in the service plugin.","commit_id":"c7020897201a4cc59c7d1cb10e7647810188969b"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"dde622167f1aa86c81e6517f4e9f4e6bb0f36c84","unresolved":false,"context_lines":[{"line_number":386,"context_line":"        try:"},{"line_number":387,"context_line":"            self.p_client.delete_resource_provider(event.segment_id)"},{"line_number":388,"context_line":"        except placement_exc.PlacementClientError:"},{"line_number":389,"context_line":"            LOG.info(\u0027Segment %s resource provider not found\u0027,"},{"line_number":390,"context_line":"                     event.segment_id)"},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"    @registry.receives(resources.SEGMENT_HOST_MAPPING, [events.AFTER_CREATE])"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_411bbd7f","line":389,"range":{"start_line":389,"start_character":51,"end_line":389,"end_character":60},"in_reply_to":"ff570b3c_6d96ba40","updated":"2020-05-18 17:52:03.000000000","message":"Not always. That could be just an error in the Placement service. I\u0027ll update this message.\n\nWe don\u0027t care too much about the info we provide to the Placement service. If the service is down or the message sent is not received, we don\u0027t raise any exception or retry it. That could lead to a resource desynchronization.","commit_id":"c7020897201a4cc59c7d1cb10e7647810188969b"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"2191840e6b16f35e536af0b2337abbd547bc4451","unresolved":false,"context_lines":[{"line_number":361,"context_line":"                self.batch_notifier.queue_event(Event("},{"line_number":362,"context_line":"                    self._delete_nova_inventory, segment_id))"},{"line_number":363,"context_line":""},{"line_number":364,"context_line":"    def _get_aggregate_id(self, segment_id):"},{"line_number":365,"context_line":"        try:"},{"line_number":366,"context_line":"            aggregate_uuid \u003d self.p_client.list_aggregates("},{"line_number":367,"context_line":"                segment_id)[\u0027aggregates\u0027][0]"},{"line_number":368,"context_line":"        except placement_exc.PlacementAggregateNotFound:"},{"line_number":369,"context_line":"            LOG.info(\u0027Segment %s resource provider aggregate not found\u0027,"},{"line_number":370,"context_line":"                     segment_id)"},{"line_number":371,"context_line":"            return"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":"        for aggregate in self.n_client.aggregates.list():"},{"line_number":374,"context_line":"            nc_aggregate_uuid \u003d self._get_nova_aggregate_uuid(aggregate)"},{"line_number":375,"context_line":"            if nc_aggregate_uuid \u003d\u003d aggregate_uuid:"},{"line_number":376,"context_line":"                return aggregate.id"},{"line_number":377,"context_line":""},{"line_number":378,"context_line":"    def _delete_nova_inventory(self, event):"},{"line_number":379,"context_line":"        aggregate_id \u003d self._get_aggregate_id(event.segment_id)"},{"line_number":380,"context_line":"        if aggregate_id:"},{"line_number":381,"context_line":"            aggregate \u003d self.n_client.aggregates.get_details(aggregate_id)"},{"line_number":382,"context_line":"            for host in aggregate.hosts:"},{"line_number":383,"context_line":"                self.n_client.aggregates.remove_host(aggregate_id, host)"},{"line_number":384,"context_line":"            self.n_client.aggregates.delete(aggregate_id)"},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"        try:"},{"line_number":387,"context_line":"            self.p_client.delete_resource_provider(event.segment_id)"},{"line_number":388,"context_line":"        except placement_exc.PlacementClientError:"},{"line_number":389,"context_line":"            LOG.info(\u0027Segment %s resource provider not found\u0027,"},{"line_number":390,"context_line":"                     event.segment_id)"},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"    @registry.receives(resources.SEGMENT_HOST_MAPPING, [events.AFTER_CREATE])"},{"line_number":393,"context_line":"    def _notify_host_addition_to_aggregate(self, resource, event, trigger,"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_31908ded","line":390,"range":{"start_line":364,"start_character":0,"end_line":390,"end_character":38},"updated":"2020-05-19 10:19:21.000000000","message":"Are these changes tightly related to the original bug?\nIf it is related to the original performance issue worth mention this one as well in commit msg I think","commit_id":"c7020897201a4cc59c7d1cb10e7647810188969b"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"3268d3168f9a32894cf350fdb021338b37c90e7b","unresolved":false,"context_lines":[{"line_number":361,"context_line":"                self.batch_notifier.queue_event(Event("},{"line_number":362,"context_line":"                    self._delete_nova_inventory, segment_id))"},{"line_number":363,"context_line":""},{"line_number":364,"context_line":"    def _get_aggregate_id(self, segment_id):"},{"line_number":365,"context_line":"        try:"},{"line_number":366,"context_line":"            aggregate_uuid \u003d self.p_client.list_aggregates("},{"line_number":367,"context_line":"                segment_id)[\u0027aggregates\u0027][0]"},{"line_number":368,"context_line":"        except placement_exc.PlacementAggregateNotFound:"},{"line_number":369,"context_line":"            LOG.info(\u0027Segment %s resource provider aggregate not found\u0027,"},{"line_number":370,"context_line":"                     segment_id)"},{"line_number":371,"context_line":"            return"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":"        for aggregate in self.n_client.aggregates.list():"},{"line_number":374,"context_line":"            nc_aggregate_uuid \u003d self._get_nova_aggregate_uuid(aggregate)"},{"line_number":375,"context_line":"            if nc_aggregate_uuid \u003d\u003d aggregate_uuid:"},{"line_number":376,"context_line":"                return aggregate.id"},{"line_number":377,"context_line":""},{"line_number":378,"context_line":"    def _delete_nova_inventory(self, event):"},{"line_number":379,"context_line":"        aggregate_id \u003d self._get_aggregate_id(event.segment_id)"},{"line_number":380,"context_line":"        if aggregate_id:"},{"line_number":381,"context_line":"            aggregate \u003d self.n_client.aggregates.get_details(aggregate_id)"},{"line_number":382,"context_line":"            for host in aggregate.hosts:"},{"line_number":383,"context_line":"                self.n_client.aggregates.remove_host(aggregate_id, host)"},{"line_number":384,"context_line":"            self.n_client.aggregates.delete(aggregate_id)"},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"        try:"},{"line_number":387,"context_line":"            self.p_client.delete_resource_provider(event.segment_id)"},{"line_number":388,"context_line":"        except placement_exc.PlacementClientError:"},{"line_number":389,"context_line":"            LOG.info(\u0027Segment %s resource provider not found\u0027,"},{"line_number":390,"context_line":"                     event.segment_id)"},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"    @registry.receives(resources.SEGMENT_HOST_MAPPING, [events.AFTER_CREATE])"},{"line_number":393,"context_line":"    def _notify_host_addition_to_aggregate(self, resource, event, trigger,"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_dba30eb1","line":390,"range":{"start_line":364,"start_character":0,"end_line":390,"end_character":38},"in_reply_to":"ff570b3c_31908ded","updated":"2020-05-20 13:21:04.000000000","message":"The changes here are related. This method \"_delete_nova_inventory\" is called now from \"_notify_segment_deleted\". To avoid raising an exception in case of not finding the segment RP (that could happen if we don\u0027t have ports subnets allocated in this segment), we now catch this exception.\n\nThe same for \"_get_aggregate_id\". If the aggregate RP is not present, we should not raise any exception.\n\nThe only optimization not mentioned in the bug or the commit message is in L671, as Oleg pointed out. I\u0027ll update the commit message.","commit_id":"c7020897201a4cc59c7d1cb10e7647810188969b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"196cf9d5c1d068c59e0c94508ae5829eb1189af3","unresolved":false,"context_lines":[{"line_number":668,"context_line":"                                 subnet, **kwargs):"},{"line_number":669,"context_line":"        # If this is a routed network, remove any routes to this subnet on"},{"line_number":670,"context_line":"        # this networks remaining subnets."},{"line_number":671,"context_line":"        if kwargs.get(db.FOR_NET_DELETE):"},{"line_number":672,"context_line":"            return  # skip subnet update if the network is going to be deleted"},{"line_number":673,"context_line":""},{"line_number":674,"context_line":"        if subnet.get(\u0027segment_id\u0027):"},{"line_number":675,"context_line":"            self._update_routed_network_host_routes("}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_2d15e29c","line":672,"range":{"start_line":671,"start_character":8,"end_line":672,"end_character":78},"updated":"2020-05-18 15:12:40.000000000","message":"this optimization is probably worth mentioning in commit message as well","commit_id":"c7020897201a4cc59c7d1cb10e7647810188969b"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"dde622167f1aa86c81e6517f4e9f4e6bb0f36c84","unresolved":false,"context_lines":[{"line_number":668,"context_line":"                                 subnet, **kwargs):"},{"line_number":669,"context_line":"        # If this is a routed network, remove any routes to this subnet on"},{"line_number":670,"context_line":"        # this networks remaining subnets."},{"line_number":671,"context_line":"        if kwargs.get(db.FOR_NET_DELETE):"},{"line_number":672,"context_line":"            return  # skip subnet update if the network is going to be deleted"},{"line_number":673,"context_line":""},{"line_number":674,"context_line":"        if subnet.get(\u0027segment_id\u0027):"},{"line_number":675,"context_line":"            self._update_routed_network_host_routes("}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_9c109e50","line":672,"range":{"start_line":671,"start_character":8,"end_line":672,"end_character":78},"in_reply_to":"ff570b3c_2d15e29c","updated":"2020-05-18 17:52:03.000000000","message":"Agree, I didn\u0027t mentioned it.","commit_id":"c7020897201a4cc59c7d1cb10e7647810188969b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"2cfa25fb3f62801a0797a74d01ff6f208efc4d6f","unresolved":false,"context_lines":[{"line_number":386,"context_line":"        try:"},{"line_number":387,"context_line":"            self.p_client.delete_resource_provider(event.segment_id)"},{"line_number":388,"context_line":"        except placement_exc.PlacementClientError:"},{"line_number":389,"context_line":"            LOG.info(\u0027Segment %s resource provider not found\u0027,"},{"line_number":390,"context_line":"                     event.segment_id)"},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"    @registry.receives(resources.SEGMENT_HOST_MAPPING, [events.AFTER_CREATE])"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff570b3c_bf127460","line":389,"range":{"start_line":389,"start_character":21,"end_line":389,"end_character":61},"updated":"2020-05-21 06:16:09.000000000","message":"You wanted to update this message, right? Maybe include actual error string would be useful.","commit_id":"3ed8d5bb5bac1ddda605c6b99a027f5a9b7bac49"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"4b5763b563f5ed3b52be3dbe5c0253f2204dc5c3","unresolved":false,"context_lines":[{"line_number":386,"context_line":"        try:"},{"line_number":387,"context_line":"            self.p_client.delete_resource_provider(event.segment_id)"},{"line_number":388,"context_line":"        except placement_exc.PlacementClientError:"},{"line_number":389,"context_line":"            LOG.info(\u0027Segment %s resource provider not found\u0027,"},{"line_number":390,"context_line":"                     event.segment_id)"},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"    @registry.receives(resources.SEGMENT_HOST_MAPPING, [events.AFTER_CREATE])"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff570b3c_3cff5d35","line":389,"range":{"start_line":389,"start_character":21,"end_line":389,"end_character":61},"in_reply_to":"ff570b3c_bf127460","updated":"2020-05-25 08:32:25.000000000","message":"Done","commit_id":"3ed8d5bb5bac1ddda605c6b99a027f5a9b7bac49"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"29dcb0bfdf09bcaf6b792900ac149ff8ebffe136","unresolved":false,"context_lines":[{"line_number":666,"context_line":"    @registry.receives(resources.SUBNET, [events.AFTER_DELETE])"},{"line_number":667,"context_line":"    def host_routes_after_delete(self, resource, event, trigger, context,"},{"line_number":668,"context_line":"                                 subnet, **kwargs):"},{"line_number":669,"context_line":"        # If this is a routed network, remove any routes to this subnet on"},{"line_number":670,"context_line":"        # this networks remaining subnets."},{"line_number":671,"context_line":"        if kwargs.get(db.FOR_NET_DELETE):"},{"line_number":672,"context_line":"            return  # skip subnet update if the network is going to be deleted"},{"line_number":673,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"ff570b3c_d9061d21","line":670,"range":{"start_line":669,"start_character":8,"end_line":670,"end_character":42},"updated":"2020-05-26 14:07:44.000000000","message":"nit: I think that this comment should be below L672","commit_id":"7f40e626d6de5ec895343453b032b747c02e59f5"}]}
