)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"850cd592a19047d8bd2e3106f9c6346d2336b93a","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix bug updating port_bindings when port has been deleted"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"In the ovn gate we\u0027ve been seeing this race condition expose this bug where"},{"line_number":10,"context_line":"a port has been deleted at the sametime it\u0027s being updated via the l3_rpc"},{"line_number":11,"context_line":"interface. As a result a DBReferenceError IntegrityError is being raised"},{"line_number":12,"context_line":"because there is a forign key constrain on the port_id on the portbindings"},{"line_number":13,"context_line":"table which doesn\u0027t exist. This patch solves this problem by raising"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"5a710552_3de9441b","line":10,"range":{"start_line":10,"start_character":31,"end_line":10,"end_character":39},"updated":"2015-12-15 04:43:51.000000000","message":"typo: same time","commit_id":"d0d63dd48e62cfe24b64fc934149f23d4c721fbd"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"850cd592a19047d8bd2e3106f9c6346d2336b93a","unresolved":false,"context_lines":[{"line_number":9,"context_line":"In the ovn gate we\u0027ve been seeing this race condition expose this bug where"},{"line_number":10,"context_line":"a port has been deleted at the sametime it\u0027s being updated via the l3_rpc"},{"line_number":11,"context_line":"interface. As a result a DBReferenceError IntegrityError is being raised"},{"line_number":12,"context_line":"because there is a forign key constrain on the port_id on the portbindings"},{"line_number":13,"context_line":"table which doesn\u0027t exist. This patch solves this problem by raising"},{"line_number":14,"context_line":"PortNotFound instead of raises DBReferenceError. The fix applied here is"},{"line_number":15,"context_line":"similar to what was done reciently here: 9599e748"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"5a710552_fdf2dc05","line":12,"range":{"start_line":12,"start_character":30,"end_line":12,"end_character":39},"updated":"2015-12-15 04:43:51.000000000","message":"typo: constraint","commit_id":"d0d63dd48e62cfe24b64fc934149f23d4c721fbd"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"850cd592a19047d8bd2e3106f9c6346d2336b93a","unresolved":false,"context_lines":[{"line_number":11,"context_line":"interface. As a result a DBReferenceError IntegrityError is being raised"},{"line_number":12,"context_line":"because there is a forign key constrain on the port_id on the portbindings"},{"line_number":13,"context_line":"table which doesn\u0027t exist. This patch solves this problem by raising"},{"line_number":14,"context_line":"PortNotFound instead of raises DBReferenceError. The fix applied here is"},{"line_number":15,"context_line":"similar to what was done reciently here: 9599e748"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch also adds a unit test to check for this condition. Note,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"5a710552_ddda8078","line":14,"range":{"start_line":14,"start_character":24,"end_line":14,"end_character":30},"updated":"2015-12-15 04:43:51.000000000","message":"raising","commit_id":"d0d63dd48e62cfe24b64fc934149f23d4c721fbd"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"850cd592a19047d8bd2e3106f9c6346d2336b93a","unresolved":false,"context_lines":[{"line_number":12,"context_line":"because there is a forign key constrain on the port_id on the portbindings"},{"line_number":13,"context_line":"table which doesn\u0027t exist. This patch solves this problem by raising"},{"line_number":14,"context_line":"PortNotFound instead of raises DBReferenceError. The fix applied here is"},{"line_number":15,"context_line":"similar to what was done reciently here: 9599e748"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch also adds a unit test to check for this condition. Note,"},{"line_number":18,"context_line":"previous there was not unit tests testing the portbindings_db module"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"5a710552_3dd06453","line":15,"range":{"start_line":15,"start_character":25,"end_line":15,"end_character":34},"updated":"2015-12-15 04:43:51.000000000","message":"typo: recently","commit_id":"d0d63dd48e62cfe24b64fc934149f23d4c721fbd"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"850cd592a19047d8bd2e3106f9c6346d2336b93a","unresolved":false,"context_lines":[{"line_number":12,"context_line":"because there is a forign key constrain on the port_id on the portbindings"},{"line_number":13,"context_line":"table which doesn\u0027t exist. This patch solves this problem by raising"},{"line_number":14,"context_line":"PortNotFound instead of raises DBReferenceError. The fix applied here is"},{"line_number":15,"context_line":"similar to what was done reciently here: 9599e748"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch also adds a unit test to check for this condition. Note,"},{"line_number":18,"context_line":"previous there was not unit tests testing the portbindings_db module"},{"line_number":19,"context_line":"itself only api tests."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"5a710552_bdc45492","line":16,"range":{"start_line":15,"start_character":0,"end_line":16,"end_character":0},"updated":"2015-12-15 04:43:51.000000000","message":"it\u0027s better to reference by change-id.","commit_id":"d0d63dd48e62cfe24b64fc934149f23d4c721fbd"}],"neutron/db/portbindings_db.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5f5c69e98048cb1505f4f878b0f4c5f1380db284","unresolved":false,"context_lines":[{"line_number":91,"context_line":"                        bind_port.host \u003d host"},{"line_number":92,"context_line":"                else:"},{"line_number":93,"context_line":"                    host \u003d bind_port.host if bind_port else None"},{"line_number":94,"context_line":"        except oslo_db_exception.DBReferenceError:"},{"line_number":95,"context_line":"            raise n_exc.PortNotFound(port_id\u003dport[\u0027id\u0027])"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"        self._extend_port_dict_binding_host(port, host)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_f0e70a10","line":94,"updated":"2015-11-24 01:20:25.000000000","message":"DBReferenceError has an inner exception, which might be IntegrityError, but integrityerror can happen for more than a single reason. Are you sure it\u0027s ok to assume that the port is gone here? It\u0027s very plausible that the port you\u0027re referencing here is gone, but this is too abrupt.","commit_id":"add25c9724e219ec79a3f1b8ead0a2b5592fe0ab"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"85da250e78db8d66911f645a48f83e7ec43d1038","unresolved":false,"context_lines":[{"line_number":91,"context_line":"                        bind_port.host \u003d host"},{"line_number":92,"context_line":"                else:"},{"line_number":93,"context_line":"                    host \u003d bind_port.host if bind_port else None"},{"line_number":94,"context_line":"        except oslo_db_exception.DBReferenceError:"},{"line_number":95,"context_line":"            raise n_exc.PortNotFound(port_id\u003dport[\u0027id\u0027])"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"        self._extend_port_dict_binding_host(port, host)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a8ffd7b_fb150d49","line":94,"in_reply_to":"9a8ffd7b_127f74ab","updated":"2015-11-30 19:08:26.000000000","message":"@Gary, the reason this is failing is because this isn\u0027t occuring in the same transactions as the port_update.","commit_id":"add25c9724e219ec79a3f1b8ead0a2b5592fe0ab"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"4c551bcf3ac1fea5c2eb0a49ede0d77747879ace","unresolved":false,"context_lines":[{"line_number":91,"context_line":"                        bind_port.host \u003d host"},{"line_number":92,"context_line":"                else:"},{"line_number":93,"context_line":"                    host \u003d bind_port.host if bind_port else None"},{"line_number":94,"context_line":"        except oslo_db_exception.DBReferenceError:"},{"line_number":95,"context_line":"            raise n_exc.PortNotFound(port_id\u003dport[\u0027id\u0027])"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"        self._extend_port_dict_binding_host(port, host)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a8ffd7b_127f74ab","line":94,"in_reply_to":"9a8ffd7b_9d729de4","updated":"2015-11-25 07:59:15.000000000","message":"In the code https://github.com/openstack/networking-ovn/blob/master/networking_ovn/plugin.py#L258 it shows that the port was updated the call before.\nSo I am not sure that this is actually addressing the problem. I think that we need to understand why the l3 agent is updating a port that is deleted?","commit_id":"add25c9724e219ec79a3f1b8ead0a2b5592fe0ab"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"7844772a214b0648ece5444d7701d4c4ebc937db","unresolved":false,"context_lines":[{"line_number":91,"context_line":"                        bind_port.host \u003d host"},{"line_number":92,"context_line":"                else:"},{"line_number":93,"context_line":"                    host \u003d bind_port.host if bind_port else None"},{"line_number":94,"context_line":"        except oslo_db_exception.DBReferenceError:"},{"line_number":95,"context_line":"            raise n_exc.PortNotFound(port_id\u003dport[\u0027id\u0027])"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"        self._extend_port_dict_binding_host(port, host)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_704a3a85","line":94,"in_reply_to":"ba8a016a_30e7d2e5","updated":"2015-11-24 01:36:11.000000000","message":"by adding a query to the db for it?","commit_id":"add25c9724e219ec79a3f1b8ead0a2b5592fe0ab"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"9f7ee3d1d4aed77cd5b990dc7cf8a6b0f0a347e8","unresolved":false,"context_lines":[{"line_number":91,"context_line":"                        bind_port.host \u003d host"},{"line_number":92,"context_line":"                else:"},{"line_number":93,"context_line":"                    host \u003d bind_port.host if bind_port else None"},{"line_number":94,"context_line":"        except oslo_db_exception.DBReferenceError:"},{"line_number":95,"context_line":"            raise n_exc.PortNotFound(port_id\u003dport[\u0027id\u0027])"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"        self._extend_port_dict_binding_host(port, host)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a8ffd7b_9d729de4","line":94,"in_reply_to":"ba8a016a_704a3a85","updated":"2015-11-25 03:16:05.000000000","message":"How about adding a query to check port existence in the exception block, if the port is gone, we may don\u0027t need creating/updating portbinding for it.","commit_id":"add25c9724e219ec79a3f1b8ead0a2b5592fe0ab"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"e595bda8409bbd916d812e5670904c7ae3210cbf","unresolved":false,"context_lines":[{"line_number":91,"context_line":"                        bind_port.host \u003d host"},{"line_number":92,"context_line":"                else:"},{"line_number":93,"context_line":"                    host \u003d bind_port.host if bind_port else None"},{"line_number":94,"context_line":"        except oslo_db_exception.DBReferenceError:"},{"line_number":95,"context_line":"            raise n_exc.PortNotFound(port_id\u003dport[\u0027id\u0027])"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"        self._extend_port_dict_binding_host(port, host)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_30e7d2e5","line":94,"in_reply_to":"ba8a016a_f0e70a10","updated":"2015-11-24 01:25:18.000000000","message":"I would be more comfortable if we checked the port indeed was gone, but I can\u0027t see any other reason why this failed.","commit_id":"add25c9724e219ec79a3f1b8ead0a2b5592fe0ab"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"c7f7f85a2ae1c7e97342e006008fe54fba62a12d","unresolved":false,"context_lines":[{"line_number":94,"context_line":"            # NOTE(arosen): check if port exists still and if it doesn\u0027t"},{"line_number":95,"context_line":"            # get_port will raise PortNotFound to the caller."},{"line_number":96,"context_line":"            self.get_port(context, port[\u0027id\u0027])"},{"line_number":97,"context_line":"            # otherwise raise the DBReferenceError"},{"line_number":98,"context_line":"            raise"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        self._extend_port_dict_binding_host(port, host)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a8ffd7b_b4fb0a47","line":97,"updated":"2015-12-01 01:30:50.000000000","message":"nit: I feel strange comments cross code although I can understand your intentention. Why don\u0027t you move above?","commit_id":"7074f7ce6e1b9a33d1dd250b3e4ee39f21ee63a7"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"8514c602025c2b09d6759b76215afd1cbaa2b112","unresolved":false,"context_lines":[{"line_number":94,"context_line":"            # NOTE(arosen): check if port exists still and if it doesn\u0027t"},{"line_number":95,"context_line":"            # get_port will raise PortNotFound to the caller."},{"line_number":96,"context_line":"            self.get_port(context, port[\u0027id\u0027])"},{"line_number":97,"context_line":"            # otherwise raise the DBReferenceError"},{"line_number":98,"context_line":"            raise"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        self._extend_port_dict_binding_host(port, host)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a8ffd7b_d4a6ce52","line":97,"in_reply_to":"9a8ffd7b_b4fb0a47","updated":"2015-12-01 01:32:58.000000000","message":"I think it\u0027s nice to have the comments broken up next to the code. I see your point though but don\u0027t really have a strong preference either way.","commit_id":"7074f7ce6e1b9a33d1dd250b3e4ee39f21ee63a7"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"d0ff2c5004a70f51368b2217978c350b0d2b3c55","unresolved":false,"context_lines":[{"line_number":90,"context_line":"                        bind_port.host \u003d host"},{"line_number":91,"context_line":"                else:"},{"line_number":92,"context_line":"                    host \u003d bind_port.host if bind_port else None"},{"line_number":93,"context_line":"        except oslo_db_exception.DBReferenceError:"},{"line_number":94,"context_line":"            # NOTE(arosen): check if port exists still and if it doesn\u0027t"},{"line_number":95,"context_line":"            # get_port will raise PortNotFound to the caller."},{"line_number":96,"context_line":"            self.get_port(context, port[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_e42928e7","line":93,"updated":"2016-01-06 14:07:57.000000000","message":"maybe here just toss a RetryRequest. The L3 RPC code will just start the sync_routers task over and then you don\u0027t have to worry about mangled sessions.","commit_id":"d0d63dd48e62cfe24b64fc934149f23d4c721fbd"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"850cd592a19047d8bd2e3106f9c6346d2336b93a","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        except oslo_db_exception.DBReferenceError:"},{"line_number":94,"context_line":"            # NOTE(arosen): check if port exists still and if it doesn\u0027t"},{"line_number":95,"context_line":"            # get_port will raise PortNotFound to the caller."},{"line_number":96,"context_line":"            self.get_port(context, port[\u0027id\u0027])"},{"line_number":97,"context_line":"            # otherwise raise the DBReferenceError"},{"line_number":98,"context_line":"            raise"},{"line_number":99,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5a710552_58045e14","line":96,"updated":"2015-12-15 04:43:51.000000000","message":"ovn calls _process_portbindings_create_and_update\nin a surrounding transaction.\ndoesn\u0027t DBReferenceError break the surrounding transaction\nand this get_port fail?","commit_id":"d0d63dd48e62cfe24b64fc934149f23d4c721fbd"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"850cd592a19047d8bd2e3106f9c6346d2336b93a","unresolved":false,"context_lines":[{"line_number":95,"context_line":"            # get_port will raise PortNotFound to the caller."},{"line_number":96,"context_line":"            self.get_port(context, port[\u0027id\u0027])"},{"line_number":97,"context_line":"            # otherwise raise the DBReferenceError"},{"line_number":98,"context_line":"            raise"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        self._extend_port_dict_binding_host(port, host)"},{"line_number":101,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5a710552_9d74f8fd","line":98,"updated":"2015-12-15 04:43:51.000000000","message":"you need save_and_reraise_exception dance","commit_id":"d0d63dd48e62cfe24b64fc934149f23d4c721fbd"}],"neutron/tests/unit/db/test_portbindings_db.py":[{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"9c497867419b0f09253a32a0ecd5034fd7e09d08","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2015 OpenStack Foundation."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."},{"line_number":5,"context_line":"# You may obtain a copy of the License at"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_e8dcc574","line":2,"updated":"2015-11-19 07:20:59.000000000","message":"We don\u0027t need Copyright for OpenStack Foundation.","commit_id":"add25c9724e219ec79a3f1b8ead0a2b5592fe0ab"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3475263a47cda74b4437199c5120d054ff0714bd","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2015 OpenStack Foundation."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."},{"line_number":5,"context_line":"# You may obtain a copy of the License at"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_8332baf0","line":2,"in_reply_to":"ba8a016a_e8dcc574","updated":"2015-11-19 07:41:54.000000000","message":"i remove it if i need to push another patch set.","commit_id":"add25c9724e219ec79a3f1b8ead0a2b5592fe0ab"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"9c497867419b0f09253a32a0ecd5034fd7e09d08","unresolved":false,"context_lines":[{"line_number":32,"context_line":"        self.context \u003d context.get_admin_context()"},{"line_number":33,"context_line":"        self.plugin \u003d FakePlugin()"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def test__process_portbindings_create_and_update_port_not_found(self):"},{"line_number":36,"context_line":"        fake_port \u003d {\u0027id\u0027: \u0027does_not_exist\u0027,"},{"line_number":37,"context_line":"                     portbindings.PROFILE: \u0027foo\u0027}"},{"line_number":38,"context_line":"        port_data \u003d {portbindings.HOST_ID: \u0027host1\u0027}"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_08f10901","line":35,"updated":"2015-11-19 07:20:59.000000000","message":"test__process -\u003e test_process","commit_id":"add25c9724e219ec79a3f1b8ead0a2b5592fe0ab"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3475263a47cda74b4437199c5120d054ff0714bd","unresolved":false,"context_lines":[{"line_number":32,"context_line":"        self.context \u003d context.get_admin_context()"},{"line_number":33,"context_line":"        self.plugin \u003d FakePlugin()"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def test__process_portbindings_create_and_update_port_not_found(self):"},{"line_number":36,"context_line":"        fake_port \u003d {\u0027id\u0027: \u0027does_not_exist\u0027,"},{"line_number":37,"context_line":"                     portbindings.PROFILE: \u0027foo\u0027}"},{"line_number":38,"context_line":"        port_data \u003d {portbindings.HOST_ID: \u0027host1\u0027}"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_e33946d8","line":35,"in_reply_to":"ba8a016a_08f10901","updated":"2015-11-19 07:41:54.000000000","message":"this is a private method which starts with a _ that\u0027s why it\u0027s a  double _","commit_id":"add25c9724e219ec79a3f1b8ead0a2b5592fe0ab"}]}
