)]}'
{"neutron/plugins/ml2/drivers/l2pop/mech_driver.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"55769474ec66e95c2dafb3d3c4fefc6f0c186d73","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def _get_port_fdb_entries(self, port):"},{"line_number":43,"context_line":"        # the port might be concurrently deleted"},{"line_number":44,"context_line":"        if not port:"},{"line_number":45,"context_line":"            return []"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        return [l2pop_rpc.PortInfo(mac_address\u003dport[\u0027mac_address\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad45d7e_31108ba8","line":44,"updated":"2016-08-09 13:13:29.000000000","message":"In case \u0027fixed_ips\u0027 aren\u0027t eagerly loaded with the port model, just adjust this to\n\nif not port or not port.get(\u0027fixed_ips\u0027):\n\nthat will eliminate any concern over concurrent DB deletion without the expensive call to get_port","commit_id":"a10bb10ef38ab7bd9447aad6e9f2616805f49e0d"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"6ca9610f0d24dbc41faf1ab09ebaf4a5b2137fb4","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def _get_port_fdb_entries(self, port):"},{"line_number":43,"context_line":"        # the port might be concurrently deleted"},{"line_number":44,"context_line":"        if not port:"},{"line_number":45,"context_line":"            return []"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        return [l2pop_rpc.PortInfo(mac_address\u003dport[\u0027mac_address\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad45d7e_6c598afe","line":44,"in_reply_to":"9ad45d7e_31108ba8","updated":"2016-08-09 13:24:07.000000000","message":"+1","commit_id":"a10bb10ef38ab7bd9447aad6e9f2616805f49e0d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1506638d3e794c4900cae6d967bea13ac80037fd","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def _get_port_fdb_entries(self, port):"},{"line_number":43,"context_line":"        # the port might be concurrently deleted"},{"line_number":44,"context_line":"        if not port:"},{"line_number":45,"context_line":"            return []"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        return [l2pop_rpc.PortInfo(mac_address\u003dport[\u0027mac_address\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad45d7e_0c03ae0e","line":44,"in_reply_to":"9ad45d7e_31108ba8","updated":"2016-08-09 13:17:56.000000000","message":"Done","commit_id":"a10bb10ef38ab7bd9447aad6e9f2616805f49e0d"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"55769474ec66e95c2dafb3d3c4fefc6f0c186d73","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        return [l2pop_rpc.PortInfo(mac_address\u003dport[\u0027mac_address\u0027],"},{"line_number":48,"context_line":"                                   ip_address\u003dip[\u0027ip_address\u0027])"},{"line_number":49,"context_line":"                for ip in port[\u0027fixed_ips\u0027]]"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def delete_port_postcommit(self, context):"},{"line_number":52,"context_line":"        port \u003d context.current"}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad45d7e_9127b711","line":49,"updated":"2016-08-09 13:13:29.000000000","message":"Don\u0027t call get_port separately, that will make this even more expensive with lots of queries. Once the relationship is referenced, it\u0027s safe to use.","commit_id":"a10bb10ef38ab7bd9447aad6e9f2616805f49e0d"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"9d4fb2ae933e8b0bf612f493f33e4214439075e0","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        return [l2pop_rpc.PortInfo(mac_address\u003dport[\u0027mac_address\u0027],"},{"line_number":48,"context_line":"                                   ip_address\u003dip[\u0027ip_address\u0027])"},{"line_number":49,"context_line":"                for ip in port[\u0027fixed_ips\u0027]]"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def delete_port_postcommit(self, context):"},{"line_number":52,"context_line":"        port \u003d context.current"}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad45d7e_befd6d3c","line":49,"updated":"2016-08-09 11:33:26.000000000","message":"still port can be removed while accessing its attributes in 47-49 as it is a db object [1].\nOther callers of _get_port_fdb_entries are passing port_dict and only [1] is passing db object. So we can convert db object to port_dict to make arguments for _get_port_fdb_entries consistent and call this function at [1] like below\n\nif l2pop_db.get_agent_ip(agent) \u003d\u003d agent_ip:\n port_dict \u003d None\n try:\n   port_dict \u003d self._core_plugin.get_port(context, binding.port.id)               \n  except:\n    ...\n if port_dict:\n      fdbs.extend(self._get_port_fdb_entries(port_dict)\n\nor \nput [1] in try block so that we don\u0027t add port to fdb if it is removed.\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/drivers/l2pop/mech_driver.py#L183","commit_id":"a10bb10ef38ab7bd9447aad6e9f2616805f49e0d"}]}
