)]}'
{"neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py":[{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"ed9da60096d3d503606fa8e55795bea08f05ee94","unresolved":false,"context_lines":[{"line_number":1418,"context_line":"                        set(skipped_devices))"},{"line_number":1419,"context_line":"                skipped_updated_devices \u003d (port_info.get(\u0027updated\u0027, set()) \u0026"},{"line_number":1420,"context_line":"                        set(skipped_devices))"},{"line_number":1421,"context_line":"                if skipped_added_devices:"},{"line_number":1422,"context_line":"                    port_info[\u0027added\u0027] \u003d (port_info[\u0027added\u0027] -"},{"line_number":1423,"context_line":"                            skipped_added_devices)"},{"line_number":1424,"context_line":"                if skipped_updated_devices:"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_f65a192a","line":1421,"updated":"2015-09-01 17:12:06.000000000","message":"this \u0027if\u0027 is not needed","commit_id":"cdeb9cd8e8c9acb6896cdffb6d794563b518137d"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"ed9da60096d3d503606fa8e55795bea08f05ee94","unresolved":false,"context_lines":[{"line_number":1421,"context_line":"                if skipped_added_devices:"},{"line_number":1422,"context_line":"                    port_info[\u0027added\u0027] \u003d (port_info[\u0027added\u0027] -"},{"line_number":1423,"context_line":"                            skipped_added_devices)"},{"line_number":1424,"context_line":"                if skipped_updated_devices:"},{"line_number":1425,"context_line":"                    port_info[\u0027updated\u0027] \u003d (port_info[\u0027updated\u0027] -"},{"line_number":1426,"context_line":"                            skipped_updated_devices)"},{"line_number":1427,"context_line":"                    port_info[\u0027removed\u0027] \u003d (port_info.get(\u0027removed\u0027, set()) |"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_7647e94b","line":1424,"updated":"2015-09-01 17:12:06.000000000","message":"ditto","commit_id":"cdeb9cd8e8c9acb6896cdffb6d794563b518137d"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"9d79d6cdbc9fa58dcd5dc1400e71a58884c73450","unresolved":false,"context_lines":[{"line_number":1421,"context_line":"                if skipped_added_devices:"},{"line_number":1422,"context_line":"                    port_info[\u0027added\u0027] \u003d (port_info[\u0027added\u0027] -"},{"line_number":1423,"context_line":"                            skipped_added_devices)"},{"line_number":1424,"context_line":"                if skipped_updated_devices:"},{"line_number":1425,"context_line":"                    port_info[\u0027updated\u0027] \u003d (port_info[\u0027updated\u0027] -"},{"line_number":1426,"context_line":"                            skipped_updated_devices)"},{"line_number":1427,"context_line":"                    port_info[\u0027removed\u0027] \u003d (port_info.get(\u0027removed\u0027, set()) |"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_423c312f","line":1424,"in_reply_to":"da20952f_28980a6a","updated":"2015-09-02 13:23:51.000000000","message":"you can directly do set minus without checking whether set is none or not.","commit_id":"cdeb9cd8e8c9acb6896cdffb6d794563b518137d"},{"author":{"_account_id":18043,"name":"Zhangqi Chen","email":"chenzhangqi@360.cn","username":"chen"},"change_message_id":"f4fa79f5061b1954d4602a69d6027d50b35d13d0","unresolved":false,"context_lines":[{"line_number":1421,"context_line":"                if skipped_added_devices:"},{"line_number":1422,"context_line":"                    port_info[\u0027added\u0027] \u003d (port_info[\u0027added\u0027] -"},{"line_number":1423,"context_line":"                            skipped_added_devices)"},{"line_number":1424,"context_line":"                if skipped_updated_devices:"},{"line_number":1425,"context_line":"                    port_info[\u0027updated\u0027] \u003d (port_info[\u0027updated\u0027] -"},{"line_number":1426,"context_line":"                            skipped_updated_devices)"},{"line_number":1427,"context_line":"                    port_info[\u0027removed\u0027] \u003d (port_info.get(\u0027removed\u0027, set()) |"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_e632acf1","line":1424,"in_reply_to":"da20952f_423c312f","updated":"2015-09-06 02:54:53.000000000","message":"Are you sure? A error occurred while do\n\u0027port_info[\u0027updated\u0027] \u003d port_info[\u0027updated\u0027] - skipped_devices\u0027\nKeyError: \u0027updated\u0027\n\nbecause port_info[\u0027updated\u0027] never been assigned.","commit_id":"cdeb9cd8e8c9acb6896cdffb6d794563b518137d"},{"author":{"_account_id":18043,"name":"Zhangqi Chen","email":"chenzhangqi@360.cn","username":"chen"},"change_message_id":"5bbf5f4953a5e25314dbe23039f13c719da829cc","unresolved":false,"context_lines":[{"line_number":1421,"context_line":"                if skipped_added_devices:"},{"line_number":1422,"context_line":"                    port_info[\u0027added\u0027] \u003d (port_info[\u0027added\u0027] -"},{"line_number":1423,"context_line":"                            skipped_added_devices)"},{"line_number":1424,"context_line":"                if skipped_updated_devices:"},{"line_number":1425,"context_line":"                    port_info[\u0027updated\u0027] \u003d (port_info[\u0027updated\u0027] -"},{"line_number":1426,"context_line":"                            skipped_updated_devices)"},{"line_number":1427,"context_line":"                    port_info[\u0027removed\u0027] \u003d (port_info.get(\u0027removed\u0027, set()) |"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_28980a6a","line":1424,"in_reply_to":"da20952f_7647e94b","updated":"2015-09-02 08:43:47.000000000","message":"Because, mayebe port_info[\u0027updated\u0027] is null.","commit_id":"cdeb9cd8e8c9acb6896cdffb6d794563b518137d"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"bb7c7a9886f98484f636835eabc7a39d5f491d72","unresolved":false,"context_lines":[{"line_number":1421,"context_line":"                if skipped_added_devices:"},{"line_number":1422,"context_line":"                    port_info[\u0027added\u0027] \u003d (port_info[\u0027added\u0027] -"},{"line_number":1423,"context_line":"                            skipped_added_devices)"},{"line_number":1424,"context_line":"                if skipped_updated_devices:"},{"line_number":1425,"context_line":"                    port_info[\u0027updated\u0027] \u003d (port_info[\u0027updated\u0027] -"},{"line_number":1426,"context_line":"                            skipped_updated_devices)"},{"line_number":1427,"context_line":"                    port_info[\u0027removed\u0027] \u003d (port_info.get(\u0027removed\u0027, set()) |"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_c6a688c0","line":1424,"in_reply_to":"da20952f_e632acf1","updated":"2015-09-06 03:32:09.000000000","message":"Ok, I was try to explain Rossella\u0027s comment \"ditto\".\n\nYes, per method scan_ports, port_info[\u0027updated\u0027] may not get assigned. But I think we can avoid KeyError here, like:\nport_info[\u0027updated\u0027] \u003d port_info.get(\u0027updated\u0027, set()) - set(skipped_devices)\n\nBTW, please rebase your patch.","commit_id":"cdeb9cd8e8c9acb6896cdffb6d794563b518137d"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"ed9da60096d3d503606fa8e55795bea08f05ee94","unresolved":false,"context_lines":[{"line_number":1424,"context_line":"                if skipped_updated_devices:"},{"line_number":1425,"context_line":"                    port_info[\u0027updated\u0027] \u003d (port_info[\u0027updated\u0027] -"},{"line_number":1426,"context_line":"                            skipped_updated_devices)"},{"line_number":1427,"context_line":"                    port_info[\u0027removed\u0027] \u003d (port_info.get(\u0027removed\u0027, set()) |"},{"line_number":1428,"context_line":"                            skipped_updated_devices)"},{"line_number":1429,"context_line":"            except DeviceListRetrievalError:"},{"line_number":1430,"context_line":"                # Need to resync as there was an error with server"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_3be4faaa","line":1427,"updated":"2015-09-01 17:12:06.000000000","message":"I don\u0027t think we should modify port_info[\u0027removed\u0027] ...the following case could happen: the port is  up, the agent puts it in \u0027added\u0027, then gets removed, the agent puts it in skipped_devices. That port shouldn\u0027t be processed as \"removed\" since it was never added.\n\nThe right fix would be not to remove the skipped devices from current ports if they are updated port. At next iteration the agent will notice that they were deleted.\n\nReplace lines 1415-1420 with:\n\n\nskipped_added_devices \u003d (port_info.get(\u0027added\u0027, set()) \u0026\tset(skipped_devices))\t\n\nskipped_updated_devices \u003d (port_info.get(\u0027updated\u0027, set()) \u0026 set(skipped_devices))\n\nport_info[\u0027current\u0027] \u003d (port_info[\u0027current\u0027] - skipped_added_devices)","commit_id":"cdeb9cd8e8c9acb6896cdffb6d794563b518137d"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"9d79d6cdbc9fa58dcd5dc1400e71a58884c73450","unresolved":false,"context_lines":[{"line_number":1424,"context_line":"                if skipped_updated_devices:"},{"line_number":1425,"context_line":"                    port_info[\u0027updated\u0027] \u003d (port_info[\u0027updated\u0027] -"},{"line_number":1426,"context_line":"                            skipped_updated_devices)"},{"line_number":1427,"context_line":"                    port_info[\u0027removed\u0027] \u003d (port_info.get(\u0027removed\u0027, set()) |"},{"line_number":1428,"context_line":"                            skipped_updated_devices)"},{"line_number":1429,"context_line":"            except DeviceListRetrievalError:"},{"line_number":1430,"context_line":"                # Need to resync as there was an error with server"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_ef80ce8d","line":1427,"in_reply_to":"da20952f_23002caa","updated":"2015-09-02 13:23:51.000000000","message":"@Zhangqi Chen\nThanks for your sharing here.\nBut I\u0027m not sure eventlet.sleep is a good way to reproduce, or to get this scenario more clear. If routine halts here, port_delete will not be handled.\nAt beginning, I consider you may try to fix issue caused by ovs restarted or dead, but now, I\u0027m not sure.\n\nSorry for comments reply at 4:56 PM, its first two paragraphs is for @Rossella Sblendido, and its last paragraph is for @Zhangqi Chen.","commit_id":"cdeb9cd8e8c9acb6896cdffb6d794563b518137d"},{"author":{"_account_id":18043,"name":"Zhangqi Chen","email":"chenzhangqi@360.cn","username":"chen"},"change_message_id":"f2d8bd7371798edb2b8cf1e328046f249a8513b6","unresolved":false,"context_lines":[{"line_number":1424,"context_line":"                if skipped_updated_devices:"},{"line_number":1425,"context_line":"                    port_info[\u0027updated\u0027] \u003d (port_info[\u0027updated\u0027] -"},{"line_number":1426,"context_line":"                            skipped_updated_devices)"},{"line_number":1427,"context_line":"                    port_info[\u0027removed\u0027] \u003d (port_info.get(\u0027removed\u0027, set()) |"},{"line_number":1428,"context_line":"                            skipped_updated_devices)"},{"line_number":1429,"context_line":"            except DeviceListRetrievalError:"},{"line_number":1430,"context_line":"                # Need to resync as there was an error with server"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_5b5e7777","line":1427,"in_reply_to":"da20952f_3be4faaa","updated":"2015-09-02 03:30:16.000000000","message":"If don\u0027t remove skipped_devices from port_info[\u0027added\u0027] and port_info[\u0027updated\u0027] , self.sg_agent.setup_port_filters will process nonexistence ports.\nDo you think it is appropriate?","commit_id":"cdeb9cd8e8c9acb6896cdffb6d794563b518137d"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"65f4aee836d3cf37d4cf20bee550687463c1b96d","unresolved":false,"context_lines":[{"line_number":1424,"context_line":"                if skipped_updated_devices:"},{"line_number":1425,"context_line":"                    port_info[\u0027updated\u0027] \u003d (port_info[\u0027updated\u0027] -"},{"line_number":1426,"context_line":"                            skipped_updated_devices)"},{"line_number":1427,"context_line":"                    port_info[\u0027removed\u0027] \u003d (port_info.get(\u0027removed\u0027, set()) |"},{"line_number":1428,"context_line":"                            skipped_updated_devices)"},{"line_number":1429,"context_line":"            except DeviceListRetrievalError:"},{"line_number":1430,"context_line":"                # Need to resync as there was an error with server"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_63b5c5ce","line":1427,"in_reply_to":"da20952f_3be4faaa","updated":"2015-09-02 08:56:50.000000000","message":"The case you mentioned is hard to understand. Please check https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py#L1160, if a port is never added onto int_br, it will not be put in \u0027added\u0027.\n\nYes, let next iteration remove device exists in last \u0027current\u0027 seems make sense.\n\nBut I\u0027m still curious how will we reproduce case that, a device/port is in \u0027added\u0027 or \u0027updated\u0027, but not on int_br, and why previous mechanism couldn\u0027t handle this case.","commit_id":"cdeb9cd8e8c9acb6896cdffb6d794563b518137d"},{"author":{"_account_id":18043,"name":"Zhangqi Chen","email":"chenzhangqi@360.cn","username":"chen"},"change_message_id":"5bbf5f4953a5e25314dbe23039f13c719da829cc","unresolved":false,"context_lines":[{"line_number":1424,"context_line":"                if skipped_updated_devices:"},{"line_number":1425,"context_line":"                    port_info[\u0027updated\u0027] \u003d (port_info[\u0027updated\u0027] -"},{"line_number":1426,"context_line":"                            skipped_updated_devices)"},{"line_number":1427,"context_line":"                    port_info[\u0027removed\u0027] \u003d (port_info.get(\u0027removed\u0027, set()) |"},{"line_number":1428,"context_line":"                            skipped_updated_devices)"},{"line_number":1429,"context_line":"            except DeviceListRetrievalError:"},{"line_number":1430,"context_line":"                # Need to resync as there was an error with server"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_8303390d","line":1427,"in_reply_to":"da20952f_5b5e7777","updated":"2015-09-02 08:43:47.000000000","message":"Actually, skipped_devices were disapeared because nova-compute delete them, and notify neutron-server to do network things, if neutron-server not do relevant things in time, self.sg_agent.setup_port_filters will obtain sg infos, and setup iptables for skipped_devices. So, remove skipped_devices from port_info[\u0027added\u0027] and port_info[\u0027updated\u0027] is safer.","commit_id":"cdeb9cd8e8c9acb6896cdffb6d794563b518137d"},{"author":{"_account_id":18043,"name":"Zhangqi Chen","email":"chenzhangqi@360.cn","username":"chen"},"change_message_id":"b19ae414fe561dce93460c739d78eb41c3631347","unresolved":false,"context_lines":[{"line_number":1424,"context_line":"                if skipped_updated_devices:"},{"line_number":1425,"context_line":"                    port_info[\u0027updated\u0027] \u003d (port_info[\u0027updated\u0027] -"},{"line_number":1426,"context_line":"                            skipped_updated_devices)"},{"line_number":1427,"context_line":"                    port_info[\u0027removed\u0027] \u003d (port_info.get(\u0027removed\u0027, set()) |"},{"line_number":1428,"context_line":"                            skipped_updated_devices)"},{"line_number":1429,"context_line":"            except DeviceListRetrievalError:"},{"line_number":1430,"context_line":"                # Need to resync as there was an error with server"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_23002caa","line":1427,"in_reply_to":"da20952f_63b5c5ce","updated":"2015-09-02 09:21:09.000000000","message":"It is hard to reproduce it, the case is low probability event, but if add \u0027sleep\u0027 statement in treat_devices_added_or_updated ,it will become high  probability event. I added a sg to a port, when ovs_agent enter \u0027eventlet.sleep(60)\u0027, this port should included in port_info[\u0027current\u0027], port_info[\u0027updated\u0027], then I deleted the instance, nova-compute will remove qvo-xxxx from br-int. After ovs_agent wakeup from \u0027evenlet.sleep\u0027, it found the port disapeared, so added it into skipped devices. The previous mech will remove it from port_info[\u0027current\u0027], so scan_ports will never treat it as \u0027removed\u0027.\n\n    def treat_devices_added_or_updated(self, devices, ovs_restarted):\n        skipped_devices \u003d [] \n        need_binding_devices \u003d [] \n        security_disabled_devices \u003d [] \n        devices_details_list \u003d (\n            self.plugin_rpc.get_devices_details_list_and_failed_devices(\n                self.context,\n                devices,\n                self.agent_id,\n                self.conf.host))\n        if devices_details_list.get(\u0027failed_devices\u0027):\n            #TODO(rossella_s) handle better the resync in next patches,\n            # this is just to preserve the current behavior\n            raise DeviceListRetrievalError(devices\u003ddevices)\n+       eventlet.sleep(60)\n        devices \u003d devices_details_list.get(\u0027devices\u0027)\n        vif_by_id \u003d self.int_br.get_vifs_by_ids(\n            [vif[\u0027device\u0027] for vif in devices])\n        for details in devices:\n            device \u003d details[\u0027device\u0027]\n            LOG.debug(\"Processing port: %s\", device)\n            port \u003d vif_by_id.get(device)","commit_id":"cdeb9cd8e8c9acb6896cdffb6d794563b518137d"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"9d79d6cdbc9fa58dcd5dc1400e71a58884c73450","unresolved":false,"context_lines":[{"line_number":1424,"context_line":"                if skipped_updated_devices:"},{"line_number":1425,"context_line":"                    port_info[\u0027updated\u0027] \u003d (port_info[\u0027updated\u0027] -"},{"line_number":1426,"context_line":"                            skipped_updated_devices)"},{"line_number":1427,"context_line":"                    port_info[\u0027removed\u0027] \u003d (port_info.get(\u0027removed\u0027, set()) |"},{"line_number":1428,"context_line":"                            skipped_updated_devices)"},{"line_number":1429,"context_line":"            except DeviceListRetrievalError:"},{"line_number":1430,"context_line":"                # Need to resync as there was an error with server"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_82b489d1","line":1427,"in_reply_to":"da20952f_8303390d","updated":"2015-09-02 13:23:51.000000000","message":"\"not do relevant things in time,\", it doesn\u0027t make sense, if port deleted by nova, related info will be added into deleted_ports set, and both device and sg rules will be removed in next iteration.","commit_id":"cdeb9cd8e8c9acb6896cdffb6d794563b518137d"},{"author":{"_account_id":18043,"name":"Zhangqi Chen","email":"chenzhangqi@360.cn","username":"chen"},"change_message_id":"f4fa79f5061b1954d4602a69d6027d50b35d13d0","unresolved":false,"context_lines":[{"line_number":1424,"context_line":"                if skipped_updated_devices:"},{"line_number":1425,"context_line":"                    port_info[\u0027updated\u0027] \u003d (port_info[\u0027updated\u0027] -"},{"line_number":1426,"context_line":"                            skipped_updated_devices)"},{"line_number":1427,"context_line":"                    port_info[\u0027removed\u0027] \u003d (port_info.get(\u0027removed\u0027, set()) |"},{"line_number":1428,"context_line":"                            skipped_updated_devices)"},{"line_number":1429,"context_line":"            except DeviceListRetrievalError:"},{"line_number":1430,"context_line":"                # Need to resync as there was an error with server"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_c6520813","line":1427,"in_reply_to":"da20952f_ca460f21","updated":"2015-09-06 02:54:53.000000000","message":"@Rossella Sblendido  Sorry, I misunderstood your means.","commit_id":"cdeb9cd8e8c9acb6896cdffb6d794563b518137d"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"44ffc8475f801005802e66f412e73f9ad0fd696f","unresolved":false,"context_lines":[{"line_number":1424,"context_line":"                if skipped_updated_devices:"},{"line_number":1425,"context_line":"                    port_info[\u0027updated\u0027] \u003d (port_info[\u0027updated\u0027] -"},{"line_number":1426,"context_line":"                            skipped_updated_devices)"},{"line_number":1427,"context_line":"                    port_info[\u0027removed\u0027] \u003d (port_info.get(\u0027removed\u0027, set()) |"},{"line_number":1428,"context_line":"                            skipped_updated_devices)"},{"line_number":1429,"context_line":"            except DeviceListRetrievalError:"},{"line_number":1430,"context_line":"                # Need to resync as there was an error with server"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_7549e8cf","line":1427,"in_reply_to":"da20952f_ca460f21","updated":"2015-09-02 16:31:46.000000000","message":"@Rossella Sblendido @Zhangqi Chen\nOk, I get it, thanks.","commit_id":"cdeb9cd8e8c9acb6896cdffb6d794563b518137d"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"11e0c1f51a444269445ceed8c9187d2858f96102","unresolved":false,"context_lines":[{"line_number":1424,"context_line":"                if skipped_updated_devices:"},{"line_number":1425,"context_line":"                    port_info[\u0027updated\u0027] \u003d (port_info[\u0027updated\u0027] -"},{"line_number":1426,"context_line":"                            skipped_updated_devices)"},{"line_number":1427,"context_line":"                    port_info[\u0027removed\u0027] \u003d (port_info.get(\u0027removed\u0027, set()) |"},{"line_number":1428,"context_line":"                            skipped_updated_devices)"},{"line_number":1429,"context_line":"            except DeviceListRetrievalError:"},{"line_number":1430,"context_line":"                # Need to resync as there was an error with server"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_ca460f21","line":1427,"in_reply_to":"da20952f_ef80ce8d","updated":"2015-09-02 16:05:32.000000000","message":"\u003e If don\u0027t remove skipped_devices from port_info[\u0027added\u0027] and port_info[\u0027updated\u0027] , self.sg_agent.setup_port_filters will process nonexistence ports. Do you think it  is appropriate?\n\n@Zhangqi Chen please have a look at my previous comment again. I never wrote not to remove skipped_devices from port_info[\u0027added\u0027] and port_info[\u0027updated\u0027] exactly for the reason you mention. Even if processing not existing port is not really related to the bug you are trying to fix.\n\n\u003e The case you mentioned is hard to understand. Please check https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py#L1160, if a port is never added onto int_br, it will not be \u003eput in \u0027added\u0027.\n\n@ZongKai LI let me try to explain the case again:\n\n1) port is added to the bridge  (br-int for example)\n2) agent executes scan_ports and the port is put in \u0027added\u0027\n3) port gets deleted before the agent has a chance to process it\n4) port is put in skipped_devices\n\nActually this is the most common case of a port put in skipped_device, which other case can you imagine? Is it more clear now?","commit_id":"cdeb9cd8e8c9acb6896cdffb6d794563b518137d"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"2571e5738108fcd2f57d4ccb1f02270313b80d6b","unresolved":false,"context_lines":[{"line_number":1460,"context_line":"                port_info[\u0027added\u0027] \u003d (port_info.get(\u0027added\u0027, set()) -"},{"line_number":1461,"context_line":"                    skipped_added_devices)"},{"line_number":1462,"context_line":"                port_info[\u0027updated\u0027] \u003d (port_info.get(\u0027updated\u0027, set()) -"},{"line_number":1463,"context_line":"                    skipped_updated_devices)"},{"line_number":1464,"context_line":"                port_info[\u0027current\u0027] \u003d (port_info[\u0027current\u0027] -"},{"line_number":1465,"context_line":"                    skipped_added_devices)"},{"line_number":1466,"context_line":"            except DeviceListRetrievalError:"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_1a14d4e6","line":1463,"updated":"2015-09-06 05:13:08.000000000","message":"I\u0027m not sure,  following two lines:\n\n    skipped_updated_devices \u003d (port_info.get(\u0027updated\u0027, set()) \u0026 set(skipped_devices))\n    port_info[\u0027updated\u0027] \u003d (port_info.get(\u0027updated\u0027, set()) - skipped_updated_devices)\n\nseems equal to:\n    port_info[\u0027updated\u0027] \u003d port_info.get(\u0027updated\u0027, set()) - set(skipped_devices)","commit_id":"8439f983750f6254145e828cc3ed641c148dab9a"},{"author":{"_account_id":18043,"name":"Zhangqi Chen","email":"chenzhangqi@360.cn","username":"chen"},"change_message_id":"241ed67c673002a585f342bec63c882dab286a18","unresolved":false,"context_lines":[{"line_number":1460,"context_line":"                port_info[\u0027added\u0027] \u003d (port_info.get(\u0027added\u0027, set()) -"},{"line_number":1461,"context_line":"                    skipped_added_devices)"},{"line_number":1462,"context_line":"                port_info[\u0027updated\u0027] \u003d (port_info.get(\u0027updated\u0027, set()) -"},{"line_number":1463,"context_line":"                    skipped_updated_devices)"},{"line_number":1464,"context_line":"                port_info[\u0027current\u0027] \u003d (port_info[\u0027current\u0027] -"},{"line_number":1465,"context_line":"                    skipped_added_devices)"},{"line_number":1466,"context_line":"            except DeviceListRetrievalError:"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_1a529435","line":1463,"in_reply_to":"da20952f_1a14d4e6","updated":"2015-09-06 06:25:26.000000000","message":"You are right, the second is better.","commit_id":"8439f983750f6254145e828cc3ed641c148dab9a"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"4050022216699237f7185e78e40ed4b5be016845","unresolved":false,"context_lines":[{"line_number":1455,"context_line":"                # have been actually processed."},{"line_number":1456,"context_line":"                skipped_added_devices \u003d (port_info.get(\u0027added\u0027, set()) \u0026"},{"line_number":1457,"context_line":"                    set(skipped_devices))"},{"line_number":1458,"context_line":"                port_info[\u0027added\u0027] \u003d (port_info.get(\u0027added\u0027, set()) -"},{"line_number":1459,"context_line":"                    skipped_added_devices)"},{"line_number":1460,"context_line":"                port_info[\u0027updated\u0027] \u003d (port_info.get(\u0027updated\u0027, set()) -"},{"line_number":1461,"context_line":"                    set(skipped_devices))"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_6c07bf1d","line":1458,"updated":"2015-09-10 10:25:29.000000000","message":"Instead of modifying port_info[\u0027added\u0027] I\u0027d remove lines 1458 1459 and replace line 1474 with:\n\nadded_ports \u003d port_info.get(\u0027added\u0027, set()) - skipped_added_devices","commit_id":"e7ba7a2bdd3eaccee98c24a43092a708ed863d28"},{"author":{"_account_id":18043,"name":"Zhangqi Chen","email":"chenzhangqi@360.cn","username":"chen"},"change_message_id":"0fcaedb61ee24799e85fc4cb87fcf1f9234d0d68","unresolved":false,"context_lines":[{"line_number":1455,"context_line":"                # have been actually processed."},{"line_number":1456,"context_line":"                skipped_added_devices \u003d (port_info.get(\u0027added\u0027, set()) \u0026"},{"line_number":1457,"context_line":"                    set(skipped_devices))"},{"line_number":1458,"context_line":"                port_info[\u0027added\u0027] \u003d (port_info.get(\u0027added\u0027, set()) -"},{"line_number":1459,"context_line":"                    skipped_added_devices)"},{"line_number":1460,"context_line":"                port_info[\u0027updated\u0027] \u003d (port_info.get(\u0027updated\u0027, set()) -"},{"line_number":1461,"context_line":"                    set(skipped_devices))"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_08adaae8","line":1458,"in_reply_to":"da20952f_6c07bf1d","updated":"2015-09-11 03:28:05.000000000","message":"You are right.","commit_id":"e7ba7a2bdd3eaccee98c24a43092a708ed863d28"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"4050022216699237f7185e78e40ed4b5be016845","unresolved":false,"context_lines":[{"line_number":1457,"context_line":"                    set(skipped_devices))"},{"line_number":1458,"context_line":"                port_info[\u0027added\u0027] \u003d (port_info.get(\u0027added\u0027, set()) -"},{"line_number":1459,"context_line":"                    skipped_added_devices)"},{"line_number":1460,"context_line":"                port_info[\u0027updated\u0027] \u003d (port_info.get(\u0027updated\u0027, set()) -"},{"line_number":1461,"context_line":"                    set(skipped_devices))"},{"line_number":1462,"context_line":"                port_info[\u0027current\u0027] \u003d (port_info[\u0027current\u0027] -"},{"line_number":1463,"context_line":"                    skipped_added_devices)"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_4c5e7b46","line":1460,"updated":"2015-09-10 10:25:29.000000000","message":"does it make sense to modify port_info[\u0027updated\u0027]? port_info[\u0027updated\u0027] is passed only to setup_port_filters . We are treating the case when a port is updated and then deleted. In this case the right action would be to remove the port filters, which the agent is going to do at next cycle when processing the port delete. If we don\u0027t update the port filters (that is we subtract skipped_devices) we are not improving the current behaviour . I\u0027d leave the current behaviour and let the agent do the proper action at next iteration. Please remove lines 1460-1461","commit_id":"e7ba7a2bdd3eaccee98c24a43092a708ed863d28"},{"author":{"_account_id":18043,"name":"Zhangqi Chen","email":"chenzhangqi@360.cn","username":"chen"},"change_message_id":"0fcaedb61ee24799e85fc4cb87fcf1f9234d0d68","unresolved":false,"context_lines":[{"line_number":1457,"context_line":"                    set(skipped_devices))"},{"line_number":1458,"context_line":"                port_info[\u0027added\u0027] \u003d (port_info.get(\u0027added\u0027, set()) -"},{"line_number":1459,"context_line":"                    skipped_added_devices)"},{"line_number":1460,"context_line":"                port_info[\u0027updated\u0027] \u003d (port_info.get(\u0027updated\u0027, set()) -"},{"line_number":1461,"context_line":"                    set(skipped_devices))"},{"line_number":1462,"context_line":"                port_info[\u0027current\u0027] \u003d (port_info[\u0027current\u0027] -"},{"line_number":1463,"context_line":"                    skipped_added_devices)"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_d5518f31","line":1460,"in_reply_to":"da20952f_4c5e7b46","updated":"2015-09-11 03:28:05.000000000","message":"Yes, deleted \u0027updated ports\u0027 will be removed at next cycle, and I don\u0027t want setup_port_filters for those nonexistent ports at this cycle. So I modify port_info[\u0027updated\u0027].\n\n\u003e If we don\u0027t update the port filters (that is we subtract skipped_devices) we are not improving the current behaviour .\n\nI not sure I understand your means, if we don\u0027t update the port filters, these ports filters will be also removed at next cycle. And because these ports removed, setup_port_filter will do nothing if it cannot acquire ports info from neutron.","commit_id":"e7ba7a2bdd3eaccee98c24a43092a708ed863d28"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"7965bf15d7a2eefd4704809a90bb4d9026999580","unresolved":false,"context_lines":[{"line_number":1457,"context_line":"                    set(skipped_devices))"},{"line_number":1458,"context_line":"                port_info[\u0027added\u0027] \u003d (port_info.get(\u0027added\u0027, set()) -"},{"line_number":1459,"context_line":"                    skipped_added_devices)"},{"line_number":1460,"context_line":"                port_info[\u0027updated\u0027] \u003d (port_info.get(\u0027updated\u0027, set()) -"},{"line_number":1461,"context_line":"                    set(skipped_devices))"},{"line_number":1462,"context_line":"                port_info[\u0027current\u0027] \u003d (port_info[\u0027current\u0027] -"},{"line_number":1463,"context_line":"                    skipped_added_devices)"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_87befbfd","line":1460,"in_reply_to":"da20952f_d5518f31","updated":"2015-09-14 10:36:46.000000000","message":"We agree that these updated ports were removed, right? So which benefit are these lines adding? The filters are going to be removed anyway at next iteration. Hope it\u0027s clear now.","commit_id":"e7ba7a2bdd3eaccee98c24a43092a708ed863d28"}]}
