)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":20363,"name":"Adit Sarfaty","email":"asarfaty@vmware.com","username":"asarfaty"},"change_message_id":"e23251bf9ec6bfce25409b2b511b7c20e44fb066","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Lock subnets during port creation and subnet deletion"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The filed \"in_use\" is added to \"subnet\" DB definition. This DB"},{"line_number":10,"context_line":"register column is a flag used to mark a register as in use"},{"line_number":11,"context_line":"by other transaction. When a write DB transaction writes any"},{"line_number":12,"context_line":"value on this field, the register is locked for any other"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"df33271e_2ad6b528","line":9,"range":{"start_line":9,"start_character":4,"end_line":9,"end_character":9},"updated":"2020-03-26 04:18:23.000000000","message":"nit: field","commit_id":"1868cf6c300ad690711ca52d66e995307349fe95"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"2465eaaafba7052b376d7b37991bf67db3a48ded","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Lock subnets during port creation and subnet deletion"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The filed \"in_use\" is added to \"subnet\" DB definition. This DB"},{"line_number":10,"context_line":"register column is a flag used to mark a register as in use"},{"line_number":11,"context_line":"by other transaction. When a write DB transaction writes any"},{"line_number":12,"context_line":"value on this field, the register is locked for any other"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"df33271e_1690134e","line":9,"range":{"start_line":9,"start_character":4,"end_line":9,"end_character":9},"in_reply_to":"df33271e_2ad6b528","updated":"2020-03-28 16:00:33.000000000","message":"Done","commit_id":"1868cf6c300ad690711ca52d66e995307349fe95"}],"neutron/db/db_base_plugin_v2.py":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"9fa87184f6659b4ac8dfff2fbf9485c9618b5dce","unresolved":false,"context_lines":[{"line_number":1045,"context_line":"                resources.SUBNET, events.PRECOMMIT_DELETE_ASSOCIATIONS, self,"},{"line_number":1046,"context_line":"                payload\u003devents.DBEventPayload(context, resource_id\u003dsubnet.id))"},{"line_number":1047,"context_line":"            self._remove_subnet_ip_allocations_from_ports(context, subnet)"},{"line_number":1048,"context_line":"            self._delete_subnet_commit(context, subnet)"},{"line_number":1049,"context_line":"        registry.notify(resources.SUBNET, events.AFTER_DELETE,"},{"line_number":1050,"context_line":"                        self, context\u003dcontext, subnet\u003dsubnet.to_dict())"},{"line_number":1051,"context_line":""},{"line_number":1052,"context_line":"    def _delete_subnet_commit(self, context, subnet):"},{"line_number":1053,"context_line":"        with db_api.exc_to_retry(sql_exc.IntegrityError), \\"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f493fa4_92ac818d","line":1050,"range":{"start_line":1048,"start_character":0,"end_line":1050,"end_character":71},"updated":"2020-04-22 13:57:50.000000000","message":"I don\u0027t understand why we need 3 methods: delete_subnet(), _delete_subnet_commit() and _delete_subnet().\nIn fact those 2 lines are exactly the same as _delete_subnet() method. Do we need this _delete_subnet method?","commit_id":"f9f3d185c5adb91a5b9f79c955918ec3ecc3010e"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"07ee802fbf9952cd0ac6c507663c6fd372ec9a77","unresolved":false,"context_lines":[{"line_number":1045,"context_line":"                resources.SUBNET, events.PRECOMMIT_DELETE_ASSOCIATIONS, self,"},{"line_number":1046,"context_line":"                payload\u003devents.DBEventPayload(context, resource_id\u003dsubnet.id))"},{"line_number":1047,"context_line":"            self._remove_subnet_ip_allocations_from_ports(context, subnet)"},{"line_number":1048,"context_line":"            self._delete_subnet_commit(context, subnet)"},{"line_number":1049,"context_line":"        registry.notify(resources.SUBNET, events.AFTER_DELETE,"},{"line_number":1050,"context_line":"                        self, context\u003dcontext, subnet\u003dsubnet.to_dict())"},{"line_number":1051,"context_line":""},{"line_number":1052,"context_line":"    def _delete_subnet_commit(self, context, subnet):"},{"line_number":1053,"context_line":"        with db_api.exc_to_retry(sql_exc.IntegrityError), \\"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f493fa4_7cd37539","line":1050,"range":{"start_line":1048,"start_character":0,"end_line":1050,"end_character":71},"in_reply_to":"1f493fa4_92ac818d","updated":"2020-04-23 08:42:43.000000000","message":"I understand your concerns with this.\n\n- delete_subnet is the API entry function when a subnet is deleted. This one calls _delete_subnet_commit.\n- _delete_subnet_commit deletes the DB register, emits the precommit message and the IPAM registers\n- _delete_subnet is called from delete_network only. That will delete the DB register and will notify the after_delete event. I can\u0027t add this event to _delete_subnet_commit because I need to send the event outside the write context.\n\nInstead of having those three methods, I can remove \"_delete_subnet\" and call those two commands from delete_network","commit_id":"f9f3d185c5adb91a5b9f79c955918ec3ecc3010e"}],"neutron/db/ipam_backend_mixin.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"10d708d93bd72fc06fb0005fc6e20281bf16d967","unresolved":false,"context_lines":[{"line_number":656,"context_line":"            context, network_id, host, service_type, fixed_configured,"},{"line_number":657,"context_line":"            fixed_ips)"},{"line_number":658,"context_line":"        if subnets:"},{"line_number":659,"context_line":"            msg \u003d \u0027This subnet is being modified by other concurrent operation\u0027"},{"line_number":660,"context_line":"            for subnet in subnets:"},{"line_number":661,"context_line":"                subnet.lock_register("},{"line_number":662,"context_line":"                    context, exc.SubnetInUse(subnet_id\u003dsubnet.id, reason\u003dmsg),"}],"source_content_type":"text/x-python","patch_set":15,"id":"1f493fa4_ab1acc79","line":659,"range":{"start_line":659,"start_character":52,"end_line":659,"end_character":57},"updated":"2020-04-23 15:45:40.000000000","message":"s/another","commit_id":"e0df5bb93ffbfff6bd80103e5405fb202eb187e4"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"757158688e2a0ed3aa3cd5b15ff0267c627d1817","unresolved":false,"context_lines":[{"line_number":656,"context_line":"            context, network_id, host, service_type, fixed_configured,"},{"line_number":657,"context_line":"            fixed_ips)"},{"line_number":658,"context_line":"        if subnets:"},{"line_number":659,"context_line":"            msg \u003d \u0027This subnet is being modified by other concurrent operation\u0027"},{"line_number":660,"context_line":"            for subnet in subnets:"},{"line_number":661,"context_line":"                subnet.lock_register("},{"line_number":662,"context_line":"                    context, exc.SubnetInUse(subnet_id\u003dsubnet.id, reason\u003dmsg),"}],"source_content_type":"text/x-python","patch_set":15,"id":"1f493fa4_4155e91c","line":659,"range":{"start_line":659,"start_character":52,"end_line":659,"end_character":57},"in_reply_to":"1f493fa4_ab1acc79","updated":"2020-04-23 16:42:01.000000000","message":"Done","commit_id":"e0df5bb93ffbfff6bd80103e5405fb202eb187e4"}],"neutron/db/models_v2.py":[{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"c1d054b702b435968d35b6a848c48a75e8c96db9","unresolved":false,"context_lines":[{"line_number":43,"context_line":"                       server_default\u003dsql.false(), default\u003dFalse)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    @classmethod"},{"line_number":46,"context_line":"    def lock_register(cls, context, exception, **filters):"},{"line_number":47,"context_line":"        num_reg \u003d context.session.query("},{"line_number":48,"context_line":"            cls).filter_by(**filters).update({\u0027in_use\u0027: True})"},{"line_number":49,"context_line":"        if num_reg !\u003d 1:"}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_964bf085","line":46,"range":{"start_line":46,"start_character":4,"end_line":46,"end_character":22},"updated":"2020-04-21 13:54:33.000000000","message":"Do you think it would be a helpful signpost for a future developer to mention that this is only in use for deletion operations at the moment, which is why no unlock_register exists - the lock is deleted not unlocked.  This makes it different from a standard mutex.  I can imagine someone looking at this class without the context of the rest of this change puzzling about why there is no unlock concept.","commit_id":"542d4bbe92d839422cfc4c29f4ef52a7ec9840b6"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"2c9ade8bf0f28fba7fd6114d454d491c8e292f33","unresolved":false,"context_lines":[{"line_number":43,"context_line":"                       server_default\u003dsql.false(), default\u003dFalse)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    @classmethod"},{"line_number":46,"context_line":"    def lock_register(cls, context, exception, **filters):"},{"line_number":47,"context_line":"        num_reg \u003d context.session.query("},{"line_number":48,"context_line":"            cls).filter_by(**filters).update({\u0027in_use\u0027: True})"},{"line_number":49,"context_line":"        if num_reg !\u003d 1:"}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_47f3749f","line":46,"range":{"start_line":46,"start_character":4,"end_line":46,"end_character":22},"in_reply_to":"1f493fa4_964bf085","updated":"2020-04-21 15:13:47.000000000","message":"I\u0027ll add this info in the class description. I (we) want to be sure this mixin is used correctly.\n\nThis is not only used during the deletion operation but when IPAM is reading subnets and calculating the IPs from those subnets.\n\nThe lock lifespan is just the DB transaction where is called. Once the transaction finishes, this \"lock\" ends.","commit_id":"542d4bbe92d839422cfc4c29f4ef52a7ec9840b6"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"9fa87184f6659b4ac8dfff2fbf9485c9618b5dce","unresolved":false,"context_lines":[{"line_number":29,"context_line":"from neutron.db import standard_attr"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"# NOTE(ralonsoh): move to neutron_lib.de.model_base"},{"line_number":33,"context_line":"class HasInUse(object):"},{"line_number":34,"context_line":"    \"\"\"NeutronBaseV2 mixin, to add the flag \"in_use\" to a DB model."},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"1f493fa4_72d735ef","line":32,"range":{"start_line":32,"start_character":38,"end_line":32,"end_character":40},"updated":"2020-04-22 13:57:50.000000000","message":"nitty nit: \"db\"","commit_id":"f9f3d185c5adb91a5b9f79c955918ec3ecc3010e"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"07ee802fbf9952cd0ac6c507663c6fd372ec9a77","unresolved":false,"context_lines":[{"line_number":29,"context_line":"from neutron.db import standard_attr"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"# NOTE(ralonsoh): move to neutron_lib.de.model_base"},{"line_number":33,"context_line":"class HasInUse(object):"},{"line_number":34,"context_line":"    \"\"\"NeutronBaseV2 mixin, to add the flag \"in_use\" to a DB model."},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"1f493fa4_bcddfd43","line":32,"range":{"start_line":32,"start_character":38,"end_line":32,"end_character":40},"in_reply_to":"1f493fa4_72d735ef","updated":"2020-04-23 08:42:43.000000000","message":"Done","commit_id":"f9f3d185c5adb91a5b9f79c955918ec3ecc3010e"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"10d708d93bd72fc06fb0005fc6e20281bf16d967","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        num_reg \u003d context.session.query("},{"line_number":53,"context_line":"            cls).filter_by(**filters).update({\u0027in_use\u0027: True})"},{"line_number":54,"context_line":"        if num_reg !\u003d 1:"},{"line_number":55,"context_line":"            raise exception"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"class IPAllocationPool(model_base.BASEV2, model_base.HasId):"}],"source_content_type":"text/x-python","patch_set":15,"id":"1f493fa4_a6d2035b","line":55,"updated":"2020-04-23 15:45:40.000000000","message":"nit: raise exception if num_reg !\u003d 1 would be more pythonic :)","commit_id":"e0df5bb93ffbfff6bd80103e5405fb202eb187e4"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"757158688e2a0ed3aa3cd5b15ff0267c627d1817","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        num_reg \u003d context.session.query("},{"line_number":53,"context_line":"            cls).filter_by(**filters).update({\u0027in_use\u0027: True})"},{"line_number":54,"context_line":"        if num_reg !\u003d 1:"},{"line_number":55,"context_line":"            raise exception"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"class IPAllocationPool(model_base.BASEV2, model_base.HasId):"}],"source_content_type":"text/x-python","patch_set":15,"id":"1f493fa4_e53080eb","line":55,"in_reply_to":"1f493fa4_a6d2035b","updated":"2020-04-23 16:42:01.000000000","message":"I\u0027ve tested this and \"raise\" does not allow this syntax.","commit_id":"e0df5bb93ffbfff6bd80103e5405fb202eb187e4"}],"neutron/tests/unit/plugins/ml2/test_plugin.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"10d708d93bd72fc06fb0005fc6e20281bf16d967","unresolved":false,"context_lines":[{"line_number":3282,"context_line":"            driver_mock().remove_subnet.assert_called_with(request.subnet_id)"},{"line_number":3283,"context_line":""},{"line_number":3284,"context_line":"    def test_delete_subnet_deallocates_slaac_correctly(self):"},{"line_number":3285,"context_line":"        cidr \u003d \u00272001:100::0/64\u0027"},{"line_number":3286,"context_line":"        with self.network() as network:"},{"line_number":3287,"context_line":"            with self.subnet(network\u003dnetwork, cidr\u003dcidr,"},{"line_number":3288,"context_line":"                             ip_version\u003dconstants.IP_VERSION_6,"}],"source_content_type":"text/x-python","patch_set":15,"id":"1f493fa4_c6810f4d","line":3285,"updated":"2020-04-23 15:45:40.000000000","message":"One day we\u0027ll have to go through and move all these to the doc prefix, 2001:db8:100::0/64","commit_id":"e0df5bb93ffbfff6bd80103e5405fb202eb187e4"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"757158688e2a0ed3aa3cd5b15ff0267c627d1817","unresolved":false,"context_lines":[{"line_number":3282,"context_line":"            driver_mock().remove_subnet.assert_called_with(request.subnet_id)"},{"line_number":3283,"context_line":""},{"line_number":3284,"context_line":"    def test_delete_subnet_deallocates_slaac_correctly(self):"},{"line_number":3285,"context_line":"        cidr \u003d \u00272001:100::0/64\u0027"},{"line_number":3286,"context_line":"        with self.network() as network:"},{"line_number":3287,"context_line":"            with self.subnet(network\u003dnetwork, cidr\u003dcidr,"},{"line_number":3288,"context_line":"                             ip_version\u003dconstants.IP_VERSION_6,"}],"source_content_type":"text/x-python","patch_set":15,"id":"1f493fa4_412a0990","line":3285,"in_reply_to":"1f493fa4_c6810f4d","updated":"2020-04-23 16:42:01.000000000","message":"Done","commit_id":"e0df5bb93ffbfff6bd80103e5405fb202eb187e4"}]}
