)]}'
{"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d0b4ad53985b43782a61258dc789d9dd30ba0b3b","unresolved":false,"context_lines":[{"line_number":1308,"context_line":""},{"line_number":1309,"context_line":"        # Commit hooks may have modified the port object. Reload it."},{"line_number":1310,"context_line":"        port_db \u003d self._get_port(context, id)"},{"line_number":1311,"context_line":"        updated_port.update(self._make_port_dict(port_db))"},{"line_number":1312,"context_line":""},{"line_number":1313,"context_line":"        # Notifications must be sent after the above transaction is complete"},{"line_number":1314,"context_line":"        kwargs \u003d {"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_10e11eff","line":1311,"updated":"2017-06-23 07:47:05.000000000","message":"I am concerned of the extra load involved now. Can you elaborate on the use case?","commit_id":"efb6066bd4bc0de9386caf822ffbc4a3e93e48d8"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"1b90e31f883d9ce87be06fed3b5173e8d11eb883","unresolved":false,"context_lines":[{"line_number":1308,"context_line":""},{"line_number":1309,"context_line":"        # Commit hooks may have modified the port object. Reload it."},{"line_number":1310,"context_line":"        port_db \u003d self._get_port(context, id)"},{"line_number":1311,"context_line":"        updated_port.update(self._make_port_dict(port_db))"},{"line_number":1312,"context_line":""},{"line_number":1313,"context_line":"        # Notifications must be sent after the above transaction is complete"},{"line_number":1314,"context_line":"        kwargs \u003d {"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_103fded6","line":1311,"updated":"2017-06-23 08:08:16.000000000","message":"Yes, doing this outside of the transaction, particularily with the switch to the new enginefacade is going to trigger a full re-read of the DB. In addition to having performance overhead, it opens up a small race where something else can concurrently modify the port before the read or even delete it.\n\nThe appropriate fix is a little uglier but won\u0027t have a performance impact (well no extra DB reads).\n\nMove this block inside of the transaction and get rid of the _get_port call. Replace it with a call to context.session.flush().\n\nThis will guarantee that the revision number is bumped on the port_db object (db event is triggered on flush events, not commit) and you can then perform the updated_port.update(self._make_port_dict(port_db)) call right after that.","commit_id":"efb6066bd4bc0de9386caf822ffbc4a3e93e48d8"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"e59f8f5f88c20f771643691e6ce5fea8844da482","unresolved":false,"context_lines":[{"line_number":1308,"context_line":""},{"line_number":1309,"context_line":"        # Commit hooks may have modified the port object. Reload it."},{"line_number":1310,"context_line":"        port_db \u003d self._get_port(context, id)"},{"line_number":1311,"context_line":"        updated_port.update(self._make_port_dict(port_db))"},{"line_number":1312,"context_line":""},{"line_number":1313,"context_line":"        # Notifications must be sent after the above transaction is complete"},{"line_number":1314,"context_line":"        kwargs \u003d {"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_faf1bd6c","line":1311,"in_reply_to":"5f201791_103fded6","updated":"2017-06-25 11:28:08.000000000","message":"Done","commit_id":"efb6066bd4bc0de9386caf822ffbc4a3e93e48d8"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"ff19be4721425f1d8d005373431fccfffa20ddb3","unresolved":false,"context_lines":[{"line_number":1308,"context_line":""},{"line_number":1309,"context_line":"        # Commit hooks may have modified the port object. Reload it."},{"line_number":1310,"context_line":"        port_db \u003d self._get_port(context, id)"},{"line_number":1311,"context_line":"        updated_port.update(self._make_port_dict(port_db))"},{"line_number":1312,"context_line":""},{"line_number":1313,"context_line":"        # Notifications must be sent after the above transaction is complete"},{"line_number":1314,"context_line":"        kwargs \u003d {"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_7a05ad45","line":1311,"in_reply_to":"5f201791_faf1bd6c","updated":"2017-06-25 11:29:06.000000000","message":"Kevin, Armando, thanks for your help.","commit_id":"efb6066bd4bc0de9386caf822ffbc4a3e93e48d8"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"86f874a586150083ec7f49f1c1295b5a0851a0e5","unresolved":false,"context_lines":[{"line_number":1317,"context_line":"            \u0027mac_address_updated\u0027: mac_address_updated,"},{"line_number":1318,"context_line":"            \u0027original_port\u0027: original_port,"},{"line_number":1319,"context_line":"        }"},{"line_number":1320,"context_line":"        registry.notify(resources.PORT, events.AFTER_UPDATE, self, **kwargs)"},{"line_number":1321,"context_line":""},{"line_number":1322,"context_line":"        # Note that DVR Interface ports will have bindings on"},{"line_number":1323,"context_line":"        # multiple hosts, and so will have multiple mech_contexts,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_e2eb9ad9","line":1320,"updated":"2017-06-30 19:57:42.000000000","message":"can you write a unit test that subscribes to AFTER_UPDATE and make sure the updated port it receives has a bumped revision number?\n\nYou can add to neutron/tests/unit/services/revisions/test_revision_plugin.py","commit_id":"58438f1de11f52d162de6c1eee85c48bd39487cc"}]}
