)]}'
{"neutron/agent/linux/iptables_firewall.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"afb9adfb7af0685c38a7f399476a0639422101e2","unresolved":false,"context_lines":[{"line_number":844,"context_line":"            # and return"},{"line_number":845,"context_line":"            if self.enable_ipset and not self._reload_iptables:"},{"line_number":846,"context_line":"                self._clean_deleted_sg_rule_conntrack_entries()"},{"line_number":847,"context_line":"                self._clean_deleted_remote_sg_members_conntrack_entries()"},{"line_number":848,"context_line":"                self._pre_defer_filtered_ports \u003d None"},{"line_number":849,"context_line":"                self._pre_defer_unfiltered_ports \u003d None"},{"line_number":850,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_4a17cc44","line":847,"updated":"2016-08-05 16:14:41.000000000","message":"nit: can you put an else: here?  That way L859/860 can just be common in both and not duplicated.  I know the change will look better due to indenting L851-858...","commit_id":"b7c5cb85925b578d325190bc4299f78e0780e35d"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"61ac23c0d5217adab16e00b1d8516c3d6a3f1f9e","unresolved":false,"context_lines":[{"line_number":844,"context_line":"            # and return"},{"line_number":845,"context_line":"            if self.enable_ipset and not self._reload_iptables:"},{"line_number":846,"context_line":"                self._clean_deleted_sg_rule_conntrack_entries()"},{"line_number":847,"context_line":"                self._clean_deleted_remote_sg_members_conntrack_entries()"},{"line_number":848,"context_line":"                self._pre_defer_filtered_ports \u003d None"},{"line_number":849,"context_line":"                self._pre_defer_unfiltered_ports \u003d None"},{"line_number":850,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_52563dce","line":847,"in_reply_to":"bacf61ea_4a17cc44","updated":"2016-08-07 15:40:36.000000000","message":"sure, thanks Brian","commit_id":"b7c5cb85925b578d325190bc4299f78e0780e35d"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"482ef2df58d138ff9ae1c7a74ba151a3d7c749c2","unresolved":false,"context_lines":[{"line_number":92,"context_line":"        self.updated_rule_sg_ids \u003d set()"},{"line_number":93,"context_line":"        self.updated_sg_members \u003d set()"},{"line_number":94,"context_line":"        self.devices_with_updated_sg_members \u003d collections.defaultdict(list)"},{"line_number":95,"context_line":"        self._reload_iptables \u003d True"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def _enable_netfilter_for_bridges(self):"},{"line_number":98,"context_line":"        # we only need to set these values once, but it has to be when"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa7ab95a_fa02540a","line":95,"range":{"start_line":95,"start_character":8,"end_line":95,"end_character":12},"updated":"2016-08-30 09:37:23.000000000","message":"maybe the default the value should be false","commit_id":"4c5829c51208b8eef80abbf57fc7d047a3cf4de0"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"621c923c4b9f7317beb893150c50757fa3284e3e","unresolved":false,"context_lines":[{"line_number":126,"context_line":"    def _update_remote_security_group_members(self, sec_group_ids):"},{"line_number":127,"context_line":"        for sg_id in sec_group_ids:"},{"line_number":128,"context_line":"            for device in self.filtered_ports.values():"},{"line_number":129,"context_line":"                if sg_id in device.get(\u0027security_group_source_groups\u0027, []):"},{"line_number":130,"context_line":"                    self.devices_with_updated_sg_members[sg_id].append(device)"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def security_group_updated(self, action_type, sec_group_ids,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa7ab95a_e4bab922","line":129,"updated":"2016-08-29 08:47:26.000000000","message":"I think we should add self._reload_iptables \u003d False here","commit_id":"4c5829c51208b8eef80abbf57fc7d047a3cf4de0"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"8ee7f0188b78a3cd04178205109224fd1fd69df0","unresolved":false,"context_lines":[{"line_number":126,"context_line":"    def _update_remote_security_group_members(self, sec_group_ids):"},{"line_number":127,"context_line":"        for sg_id in sec_group_ids:"},{"line_number":128,"context_line":"            for device in self.filtered_ports.values():"},{"line_number":129,"context_line":"                if sg_id in device.get(\u0027security_group_source_groups\u0027, []):"},{"line_number":130,"context_line":"                    self.devices_with_updated_sg_members[sg_id].append(device)"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def security_group_updated(self, action_type, sec_group_ids,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa7ab95a_1fea8a0f","line":129,"in_reply_to":"fa7ab95a_e4bab922","updated":"2016-08-29 09:03:07.000000000","message":"For example, we are processing setup_port_filters(new_devices\u003d[device1]). In this case, self._reload_iptables is set to True.\n\nWhile processing setup_port_filters, we just entered Line 856 i.e filter_defer_apply_off. At the same time if we get RPC for security_group_member change, then security_group_updated will change self._reload_iptables\u003dFalse.\n\nThis will cause previous setup_port_filters, to not to apply iptables.","commit_id":"4c5829c51208b8eef80abbf57fc7d047a3cf4de0"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"621c923c4b9f7317beb893150c50757fa3284e3e","unresolved":false,"context_lines":[{"line_number":144,"context_line":"            else:"},{"line_number":145,"context_line":"                # skip reload iptables when remote agent\u0027s ports updated."},{"line_number":146,"context_line":"                # We don\u0027t set \"_reload_iptables\u003dFalse\" here, as this is"},{"line_number":147,"context_line":"                # called from RPC and  may override the value set by rpc_loop"},{"line_number":148,"context_line":"                self._update_remote_security_group_members(sec_group_ids)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def update_security_group_rules(self, sg_id, sg_rules):"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa7ab95a_c43db5bc","line":147,"updated":"2016-08-29 08:47:26.000000000","message":"what do you mean that _reload_iptables may overide the value by rpc_loop? why?","commit_id":"4c5829c51208b8eef80abbf57fc7d047a3cf4de0"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"8ee7f0188b78a3cd04178205109224fd1fd69df0","unresolved":false,"context_lines":[{"line_number":144,"context_line":"            else:"},{"line_number":145,"context_line":"                # skip reload iptables when remote agent\u0027s ports updated."},{"line_number":146,"context_line":"                # We don\u0027t set \"_reload_iptables\u003dFalse\" here, as this is"},{"line_number":147,"context_line":"                # called from RPC and  may override the value set by rpc_loop"},{"line_number":148,"context_line":"                self._update_remote_security_group_members(sec_group_ids)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def update_security_group_rules(self, sg_id, sg_rules):"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa7ab95a_3fd4ae45","line":147,"in_reply_to":"fa7ab95a_c43db5bc","updated":"2016-08-29 09:03:07.000000000","message":"above comment","commit_id":"4c5829c51208b8eef80abbf57fc7d047a3cf4de0"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"621c923c4b9f7317beb893150c50757fa3284e3e","unresolved":false,"context_lines":[{"line_number":199,"context_line":"            return"},{"line_number":200,"context_line":"        # reload iptables when sg use_enhanced_rpc not enabled"},{"line_number":201,"context_line":"        # or for refresh_firewall()"},{"line_number":202,"context_line":"        if (not self._reload_iptables and"},{"line_number":203,"context_line":"            not self.devices_with_updated_sg_members):"},{"line_number":204,"context_line":"            self._reload_iptables \u003d True"},{"line_number":205,"context_line":"        self._remove_chains()"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa7ab95a_04e4fd38","line":202,"updated":"2016-08-29 08:47:26.000000000","message":"here shoud be that:\nif not self._reload_iptables:\n    self._remove_chains()\n    ...\n    return self.iptables.apply()","commit_id":"4c5829c51208b8eef80abbf57fc7d047a3cf4de0"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"8ee7f0188b78a3cd04178205109224fd1fd69df0","unresolved":false,"context_lines":[{"line_number":199,"context_line":"            return"},{"line_number":200,"context_line":"        # reload iptables when sg use_enhanced_rpc not enabled"},{"line_number":201,"context_line":"        # or for refresh_firewall()"},{"line_number":202,"context_line":"        if (not self._reload_iptables and"},{"line_number":203,"context_line":"            not self.devices_with_updated_sg_members):"},{"line_number":204,"context_line":"            self._reload_iptables \u003d True"},{"line_number":205,"context_line":"        self._remove_chains()"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa7ab95a_5fcb32a5","line":202,"in_reply_to":"fa7ab95a_04e4fd38","updated":"2016-08-29 09:03:07.000000000","message":"above explanation","commit_id":"4c5829c51208b8eef80abbf57fc7d047a3cf4de0"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"409571ccbe0420ac2c01ae5246e912074c5b8a6c","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        self.updated_rule_sg_ids \u003d set()"},{"line_number":90,"context_line":"        self.updated_sg_members \u003d set()"},{"line_number":91,"context_line":"        self.devices_with_updated_sg_members \u003d collections.defaultdict(list)"},{"line_number":92,"context_line":"        self._skip_reload_iptables_for_remote_port \u003d False"},{"line_number":93,"context_line":"        self._reload_iptables_for_local_port \u003d False"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def _enable_netfilter_for_bridges(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a71b18c_4e4a1e56","line":92,"range":{"start_line":92,"start_character":8,"end_line":92,"end_character":50},"updated":"2016-12-07 11:35:55.000000000","message":"this var seems redundant, the logic won\u0027t change if remove this. Please correct me if I\u0027m wrong","commit_id":"e8b37ace26a2496cfdee6e63bbea91fbf7007d80"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"f9b3bdb2b5c0c86f9e25d4d5ab8ab855a5cc65be","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        self.updated_rule_sg_ids \u003d set()"},{"line_number":90,"context_line":"        self.updated_sg_members \u003d set()"},{"line_number":91,"context_line":"        self.devices_with_updated_sg_members \u003d collections.defaultdict(list)"},{"line_number":92,"context_line":"        self._skip_reload_iptables_for_remote_port \u003d False"},{"line_number":93,"context_line":"        self._reload_iptables_for_local_port \u003d False"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def _enable_netfilter_for_bridges(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a71b18c_94d1a432","line":92,"range":{"start_line":92,"start_character":8,"end_line":92,"end_character":50},"in_reply_to":"3a71b18c_4e4a1e56","updated":"2016-12-07 11:57:35.000000000","message":"my comment below","commit_id":"e8b37ace26a2496cfdee6e63bbea91fbf7007d80"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"2b0f1c0751c51ad09b982bc433229c4d9ed190c1","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        self.updated_rule_sg_ids \u003d set()"},{"line_number":90,"context_line":"        self.updated_sg_members \u003d set()"},{"line_number":91,"context_line":"        self.devices_with_updated_sg_members \u003d collections.defaultdict(list)"},{"line_number":92,"context_line":"        self._skip_reload_iptables_for_remote_port \u003d False"},{"line_number":93,"context_line":"        self._reload_iptables_for_local_port \u003d False"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def _enable_netfilter_for_bridges(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a71b18c_f7381a40","line":92,"range":{"start_line":92,"start_character":8,"end_line":92,"end_character":50},"in_reply_to":"3a71b18c_94d1a432","updated":"2016-12-07 12:24:51.000000000","message":"I won\u0027t block, but IMO if smth can be done with one var then two vars will only make it more complicated and harder to maintain.","commit_id":"e8b37ace26a2496cfdee6e63bbea91fbf7007d80"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"409571ccbe0420ac2c01ae5246e912074c5b8a6c","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        self.updated_sg_members \u003d set()"},{"line_number":91,"context_line":"        self.devices_with_updated_sg_members \u003d collections.defaultdict(list)"},{"line_number":92,"context_line":"        self._skip_reload_iptables_for_remote_port \u003d False"},{"line_number":93,"context_line":"        self._reload_iptables_for_local_port \u003d False"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def _enable_netfilter_for_bridges(self):"},{"line_number":96,"context_line":"        # we only need to set these values once, but it has to be when"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a71b18c_0e6bc6b7","line":93,"range":{"start_line":93,"start_character":13,"end_line":93,"end_character":44},"updated":"2016-12-07 11:35:55.000000000","message":"consider just need_iptables_reload","commit_id":"e8b37ace26a2496cfdee6e63bbea91fbf7007d80"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"f9b3bdb2b5c0c86f9e25d4d5ab8ab855a5cc65be","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        self.updated_sg_members \u003d set()"},{"line_number":91,"context_line":"        self.devices_with_updated_sg_members \u003d collections.defaultdict(list)"},{"line_number":92,"context_line":"        self._skip_reload_iptables_for_remote_port \u003d False"},{"line_number":93,"context_line":"        self._reload_iptables_for_local_port \u003d False"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def _enable_netfilter_for_bridges(self):"},{"line_number":96,"context_line":"        # we only need to set these values once, but it has to be when"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a71b18c_5419cc21","line":93,"range":{"start_line":93,"start_character":13,"end_line":93,"end_character":44},"in_reply_to":"3a71b18c_0e6bc6b7","updated":"2016-12-07 11:57:35.000000000","message":"Your suggestion is like in ps5 i.e https://review.openstack.org/#/c/351773/5/neutron/agent/linux/iptables_firewall.py\n\nBut that will be hard to understand especially lines 145 and 201 in the above file of ps5. So I split the logic using two variables.","commit_id":"e8b37ace26a2496cfdee6e63bbea91fbf7007d80"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"45ecadc2c99a4831ecf991d138b120a2ed618d5f","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        self.updated_rule_sg_ids \u003d set()"},{"line_number":90,"context_line":"        self.updated_sg_members \u003d set()"},{"line_number":91,"context_line":"        self.devices_with_updated_sg_members \u003d collections.defaultdict(list)"},{"line_number":92,"context_line":"        self._reload_iptables \u003d False"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def _enable_netfilter_for_bridges(self):"},{"line_number":95,"context_line":"        # we only need to set these values once, but it has to be when"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a71b18c_006972be","line":92,"range":{"start_line":92,"start_character":8,"end_line":92,"end_character":29},"updated":"2016-12-09 07:27:07.000000000","message":"Please clarify the default value (a comment would be nice to have). Isn\u0027t it safer to have it True by default and only set to False in certain cases where we know iptables reload is not needed?","commit_id":"c8f54918b87bc39b3ef2ccdd7e53d1851482c39d"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"92ca5f527030753c72a03d366296b414ad2420bb","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        self.updated_rule_sg_ids \u003d set()"},{"line_number":90,"context_line":"        self.updated_sg_members \u003d set()"},{"line_number":91,"context_line":"        self.devices_with_updated_sg_members \u003d collections.defaultdict(list)"},{"line_number":92,"context_line":"        self._reload_iptables \u003d False"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def _enable_netfilter_for_bridges(self):"},{"line_number":95,"context_line":"        # we only need to set these values once, but it has to be when"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a71b18c_40f28ad3","line":92,"range":{"start_line":92,"start_character":8,"end_line":92,"end_character":29},"in_reply_to":"3a71b18c_006972be","updated":"2016-12-09 07:32:08.000000000","message":"hi venkata anil, do you have tested this patch? i don\u0027t think it can work if just using one var, i will test it today.","commit_id":"c8f54918b87bc39b3ef2ccdd7e53d1851482c39d"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"0165c1cb5dedbd5bece0ec2980aa1af68b1be0d9","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        self.updated_rule_sg_ids \u003d set()"},{"line_number":90,"context_line":"        self.updated_sg_members \u003d set()"},{"line_number":91,"context_line":"        self.devices_with_updated_sg_members \u003d collections.defaultdict(list)"},{"line_number":92,"context_line":"        self._reload_iptables \u003d False"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def _enable_netfilter_for_bridges(self):"},{"line_number":95,"context_line":"        # we only need to set these values once, but it has to be when"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a71b18c_4330d401","line":92,"range":{"start_line":92,"start_character":8,"end_line":92,"end_character":29},"in_reply_to":"3a71b18c_00d25200","updated":"2016-12-09 08:53:12.000000000","message":"I will test","commit_id":"c8f54918b87bc39b3ef2ccdd7e53d1851482c39d"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"e62a501a48a4f130a51998e5c5ac8c082d2adb7c","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        self.updated_rule_sg_ids \u003d set()"},{"line_number":90,"context_line":"        self.updated_sg_members \u003d set()"},{"line_number":91,"context_line":"        self.devices_with_updated_sg_members \u003d collections.defaultdict(list)"},{"line_number":92,"context_line":"        self._reload_iptables \u003d False"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def _enable_netfilter_for_bridges(self):"},{"line_number":95,"context_line":"        # we only need to set these values once, but it has to be when"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a71b18c_00d25200","line":92,"range":{"start_line":92,"start_character":8,"end_line":92,"end_character":29},"in_reply_to":"3a71b18c_40f28ad3","updated":"2016-12-09 07:36:18.000000000","message":"i have tested the patchset #5, it did not work.","commit_id":"c8f54918b87bc39b3ef2ccdd7e53d1851482c39d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"45ecadc2c99a4831ecf991d138b120a2ed618d5f","unresolved":false,"context_lines":[{"line_number":198,"context_line":"            LOG.info(_LI(\u0027Attempted to update port filter which is not \u0027"},{"line_number":199,"context_line":"                         \u0027filtered %s\u0027), port[\u0027device\u0027])"},{"line_number":200,"context_line":"            return"},{"line_number":201,"context_line":"        # When securirygroups new rpc(i.e use_enhanced_rpc) disabled,"},{"line_number":202,"context_line":"        # security_group_updated is not called, hence _reload_iptables"},{"line_number":203,"context_line":"        # won\u0027t be set. In this case, we have to set this flag here."},{"line_number":204,"context_line":"        if (not self._reload_iptables and"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a71b18c_00141242","line":201,"range":{"start_line":201,"start_character":42,"end_line":201,"end_character":58},"updated":"2016-12-09 07:27:07.000000000","message":"Not related to current patch: it\u0027s been 2+ releases since server supports new rpc, is it time to cleanup old code paths and remove this condition?","commit_id":"c8f54918b87bc39b3ef2ccdd7e53d1851482c39d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"45ecadc2c99a4831ecf991d138b120a2ed618d5f","unresolved":false,"context_lines":[{"line_number":198,"context_line":"            LOG.info(_LI(\u0027Attempted to update port filter which is not \u0027"},{"line_number":199,"context_line":"                         \u0027filtered %s\u0027), port[\u0027device\u0027])"},{"line_number":200,"context_line":"            return"},{"line_number":201,"context_line":"        # When securirygroups new rpc(i.e use_enhanced_rpc) disabled,"},{"line_number":202,"context_line":"        # security_group_updated is not called, hence _reload_iptables"},{"line_number":203,"context_line":"        # won\u0027t be set. In this case, we have to set this flag here."},{"line_number":204,"context_line":"        if (not self._reload_iptables and"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a71b18c_baed4c90","line":201,"range":{"start_line":201,"start_character":15,"end_line":201,"end_character":23},"updated":"2016-12-09 07:27:07.000000000","message":"typo in \u0027security\u0027","commit_id":"c8f54918b87bc39b3ef2ccdd7e53d1851482c39d"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"51ae0dbc2eeefd05548783b27f9482654f72eff0","unresolved":false,"context_lines":[{"line_number":875,"context_line":"        if self._defer_apply:"},{"line_number":876,"context_line":"            self._defer_apply \u003d False"},{"line_number":877,"context_line":"            if self.check_iptables_apply():"},{"line_number":878,"context_line":"                self.iptables_apply()"},{"line_number":879,"context_line":"            self._pre_defer_filtered_ports \u003d None"},{"line_number":880,"context_line":"            self._pre_defer_unfiltered_ports \u003d None"},{"line_number":881,"context_line":"            self._reload_iptables \u003d False"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a430d35_d14c56ca","line":878,"updated":"2017-02-08 03:47:35.000000000","message":"You still want to call _remove_conntrack_entries_from_sg_updates even if _reload_iptables is false, don\u0027t you?","commit_id":"b10fd60ef6d02d2f02a447dbd91dd65e9b8b89bf"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"499abe3ee795eb1ada01e82ed648eb82e2115b99","unresolved":false,"context_lines":[{"line_number":875,"context_line":"        if self._defer_apply:"},{"line_number":876,"context_line":"            self._defer_apply \u003d False"},{"line_number":877,"context_line":"            if self.check_iptables_apply():"},{"line_number":878,"context_line":"                self.iptables_apply()"},{"line_number":879,"context_line":"            self._pre_defer_filtered_ports \u003d None"},{"line_number":880,"context_line":"            self._pre_defer_unfiltered_ports \u003d None"},{"line_number":881,"context_line":"            self._reload_iptables \u003d False"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a430d35_05d2185c","line":878,"in_reply_to":"1a430d35_d14c56ca","updated":"2017-02-08 07:11:26.000000000","message":"Yes. Thanks, I will update.","commit_id":"b10fd60ef6d02d2f02a447dbd91dd65e9b8b89bf"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"51ae0dbc2eeefd05548783b27f9482654f72eff0","unresolved":false,"context_lines":[{"line_number":881,"context_line":"            self._reload_iptables \u003d False"},{"line_number":882,"context_line":""},{"line_number":883,"context_line":"    def check_iptables_apply(self):"},{"line_number":884,"context_line":"        # relaod iptables when ipset is disabled or"},{"line_number":885,"context_line":"        # aget is not using sg_rpc"},{"line_number":886,"context_line":"        if not self.enable_ipset:"},{"line_number":887,"context_line":"            return True"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a430d35_f14952b8","line":884,"range":{"start_line":884,"start_character":10,"end_line":884,"end_character":16},"updated":"2017-02-08 03:47:35.000000000","message":"typo","commit_id":"b10fd60ef6d02d2f02a447dbd91dd65e9b8b89bf"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"51ae0dbc2eeefd05548783b27f9482654f72eff0","unresolved":false,"context_lines":[{"line_number":882,"context_line":""},{"line_number":883,"context_line":"    def check_iptables_apply(self):"},{"line_number":884,"context_line":"        # relaod iptables when ipset is disabled or"},{"line_number":885,"context_line":"        # aget is not using sg_rpc"},{"line_number":886,"context_line":"        if not self.enable_ipset:"},{"line_number":887,"context_line":"            return True"},{"line_number":888,"context_line":"        elif not (self.sg_rules"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a430d35_11c97e26","line":885,"range":{"start_line":885,"start_character":10,"end_line":885,"end_character":14},"updated":"2017-02-08 03:47:35.000000000","message":"typo","commit_id":"b10fd60ef6d02d2f02a447dbd91dd65e9b8b89bf"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"d7cc2344677e972f7b6750a7b4a120fb38afe75d","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        self.updated_rule_sg_ids \u003d set()"},{"line_number":90,"context_line":"        self.updated_sg_members \u003d set()"},{"line_number":91,"context_line":"        self.devices_with_updated_sg_members \u003d collections.defaultdict(list)"},{"line_number":92,"context_line":"        self._reload_iptables \u003d False"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def _enable_netfilter_for_bridges(self):"},{"line_number":95,"context_line":"        # we only need to set these values once, but it has to be when"}],"source_content_type":"text/x-python","patch_set":12,"id":"da36d5c6_726d40cb","line":92,"updated":"2017-02-24 16:51:56.000000000","message":"I would prefer that we invert the default to be True. Skipping an iptables reload by default can leave us exposed to bugs where the flag should have been True and rule updates aren\u0027t reflected correctly.\n\nBut if we default to True and there was a case where we could have set it to false, security groups will still behave correctly, it just won\u0027t be as efficient since it\u0027s an unnecessary reload.","commit_id":"e269845c49aef60a53392d52b0c6070309aab7cf"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"91a643f2f8657bff0b074803f932177c8495d3c5","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        self.updated_rule_sg_ids \u003d set()"},{"line_number":90,"context_line":"        self.updated_sg_members \u003d set()"},{"line_number":91,"context_line":"        self.devices_with_updated_sg_members \u003d collections.defaultdict(list)"},{"line_number":92,"context_line":"        self._reload_iptables \u003d False"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def _enable_netfilter_for_bridges(self):"},{"line_number":95,"context_line":"        # we only need to set these values once, but it has to be when"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a30ddce_51b771f4","line":92,"in_reply_to":"da36d5c6_726d40cb","updated":"2017-03-10 13:35:22.000000000","message":"done","commit_id":"e269845c49aef60a53392d52b0c6070309aab7cf"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"9db68c508152035d9017dbe2de7cbb58371dd47f","unresolved":false,"context_lines":[{"line_number":874,"context_line":"            self._pre_defer_unfiltered_ports \u003d None"},{"line_number":875,"context_line":"            self._reload_iptables \u003d True"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"    def iptables_apply(self):"},{"line_number":878,"context_line":"        self._remove_chains_apply(self._pre_defer_filtered_ports,"},{"line_number":879,"context_line":"                                  self._pre_defer_unfiltered_ports)"},{"line_number":880,"context_line":"        self._setup_chains_apply(self.filtered_ports,"}],"source_content_type":"text/x-python","patch_set":14,"id":"7ffa3b31_8cd0ba52","line":877,"updated":"2017-04-14 22:46:28.000000000","message":"nit: we should prefix this with a \u0027_\u0027 since users aren\u0027t supposed to call this directly.","commit_id":"da572446ca46c96557faba636687b516721e1351"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"89fdd56cdbcd3eadad79ff97f69491b64402ec84","unresolved":false,"context_lines":[{"line_number":110,"context_line":"            else:"},{"line_number":111,"context_line":"                # skip applying iptables when remote agent\u0027s ports updated"},{"line_number":112,"context_line":"                if self.enable_ipset:"},{"line_number":113,"context_line":"                    self._reload_iptables \u003d False"},{"line_number":114,"context_line":"                self._update_remote_security_group_members(sec_group_ids)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def process_trusted_ports(self, port_ids):"}],"source_content_type":"text/x-python","patch_set":17,"id":"9f6a8fd7_c7aae5d0","line":113,"updated":"2018-04-19 09:16:38.000000000","message":"isn\u0027t this prone to race conditions? AFAIK there is more than one rpc worker consuming messages like SG update, right?\nSo can\u0027t it cause something like:\n1. Worker A get sg_update with \"sg_rule\" action type so iptables should be reloaded,\n2. just after that worker B starts another sg_update with action_type\u003d\"sg_member\" so _reload_iptables is set to False\n3. Worker A will not reload iptables in filter_defer_apply_off()\n\nIs something like that possible here?","commit_id":"c0224cead3e5f5d2f728af9fb73fbb97c72c6925"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"20e6cffd16efd48aaeb89a78446701ad7ffd087f","unresolved":false,"context_lines":[{"line_number":110,"context_line":"            else:"},{"line_number":111,"context_line":"                # skip applying iptables when remote agent\u0027s ports updated"},{"line_number":112,"context_line":"                if self.enable_ipset:"},{"line_number":113,"context_line":"                    self._reload_iptables \u003d False"},{"line_number":114,"context_line":"                self._update_remote_security_group_members(sec_group_ids)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def process_trusted_ports(self, port_ids):"}],"source_content_type":"text/x-python","patch_set":17,"id":"9f6a8fd7_cd099f2c","line":113,"in_reply_to":"9f6a8fd7_c7aae5d0","updated":"2018-04-19 14:01:26.000000000","message":"Slawek - I think there are only multiple rpc workers on the server side, not the agent, so this should be one at a time, right?","commit_id":"c0224cead3e5f5d2f728af9fb73fbb97c72c6925"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"da875efed8bd8b4be390de229a121ca7316df268","unresolved":false,"context_lines":[{"line_number":110,"context_line":"            else:"},{"line_number":111,"context_line":"                # skip applying iptables when remote agent\u0027s ports updated"},{"line_number":112,"context_line":"                if self.enable_ipset:"},{"line_number":113,"context_line":"                    self._reload_iptables \u003d False"},{"line_number":114,"context_line":"                self._update_remote_security_group_members(sec_group_ids)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def process_trusted_ports(self, port_ids):"}],"source_content_type":"text/x-python","patch_set":17,"id":"9f6a8fd7_d009342c","line":113,"in_reply_to":"9f6a8fd7_cd099f2c","updated":"2018-04-19 14:32:30.000000000","message":"You are probably right. There is no rpc_workers used in agent\u0027s code so it\u0027s probably safe :)","commit_id":"c0224cead3e5f5d2f728af9fb73fbb97c72c6925"}],"neutron/agent/securitygroups_rpc.py":[{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"51ae0dbc2eeefd05548783b27f9482654f72eff0","unresolved":false,"context_lines":[{"line_number":224,"context_line":"            if self.defer_refresh_firewall:"},{"line_number":225,"context_line":"                if devices and self.use_enhanced_rpc:"},{"line_number":226,"context_line":"                    self.firewall.security_group_updated(\u0027sg_member\u0027, [],"},{"line_number":227,"context_line":"                                                         devices)"},{"line_number":228,"context_line":"                self.devices_to_refilter |\u003d set(devices)"},{"line_number":229,"context_line":"            else:"},{"line_number":230,"context_line":"                self.refresh_firewall(devices)"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a430d35_71eac2ad","line":227,"updated":"2017-02-08 03:47:35.000000000","message":"why this change?","commit_id":"b10fd60ef6d02d2f02a447dbd91dd65e9b8b89bf"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"8a1533d78d94137beff18faaf9923b76fb8a735d","unresolved":false,"context_lines":[{"line_number":224,"context_line":"            if self.defer_refresh_firewall:"},{"line_number":225,"context_line":"                if devices and self.use_enhanced_rpc:"},{"line_number":226,"context_line":"                    self.firewall.security_group_updated(\u0027sg_member\u0027, [],"},{"line_number":227,"context_line":"                                                         devices)"},{"line_number":228,"context_line":"                self.devices_to_refilter |\u003d set(devices)"},{"line_number":229,"context_line":"            else:"},{"line_number":230,"context_line":"                self.refresh_firewall(devices)"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa31d9ce_d5f3b008","line":227,"in_reply_to":"1a430d35_69c8db55","updated":"2017-02-13 03:41:29.000000000","message":"No, unless you call security_group_updated. If we are using \"use_enhanced_rpc\", security_group_updated is must to reload iptables.","commit_id":"b10fd60ef6d02d2f02a447dbd91dd65e9b8b89bf"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"499abe3ee795eb1ada01e82ed648eb82e2115b99","unresolved":false,"context_lines":[{"line_number":224,"context_line":"            if self.defer_refresh_firewall:"},{"line_number":225,"context_line":"                if devices and self.use_enhanced_rpc:"},{"line_number":226,"context_line":"                    self.firewall.security_group_updated(\u0027sg_member\u0027, [],"},{"line_number":227,"context_line":"                                                         devices)"},{"line_number":228,"context_line":"                self.devices_to_refilter |\u003d set(devices)"},{"line_number":229,"context_line":"            else:"},{"line_number":230,"context_line":"                self.refresh_firewall(devices)"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a430d35_a525c409","line":227,"in_reply_to":"1a430d35_71eac2ad","updated":"2017-02-08 07:11:26.000000000","message":"security_group_updated is called when a security group is updated [1] through new security groups RPC. And this method is already called when security_groups_rule_updated and security_groups_member_updated but missing for security_groups_provider_updated. Inside security_group_updated, we set reload_iptables if rules or local ports are updated. In this case, provider is updated so this network\u0027s ports on this agent has to reload the iptables(i.e dhcp rule is updated, so all ports has to reload iptables) [2].\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/agent/firewall.py#L151\n[2] https://github.com/openstack/neutron/blob/master/neutron/db/securitygroups_rpc_base.py#L127","commit_id":"b10fd60ef6d02d2f02a447dbd91dd65e9b8b89bf"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"1f8f174f91d3dc1579118a23f3660f8ca9a0c7d2","unresolved":false,"context_lines":[{"line_number":224,"context_line":"            if self.defer_refresh_firewall:"},{"line_number":225,"context_line":"                if devices and self.use_enhanced_rpc:"},{"line_number":226,"context_line":"                    self.firewall.security_group_updated(\u0027sg_member\u0027, [],"},{"line_number":227,"context_line":"                                                         devices)"},{"line_number":228,"context_line":"                self.devices_to_refilter |\u003d set(devices)"},{"line_number":229,"context_line":"            else:"},{"line_number":230,"context_line":"                self.refresh_firewall(devices)"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a430d35_69c8db55","line":227,"in_reply_to":"1a430d35_a525c409","updated":"2017-02-09 08:09:14.000000000","message":"Those devices\u0027 iptables will be reloaded by a refresh_firewall call in setup_port_filters. Isn\u0027t that enough?","commit_id":"b10fd60ef6d02d2f02a447dbd91dd65e9b8b89bf"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"d7cc2344677e972f7b6750a7b4a120fb38afe75d","unresolved":false,"context_lines":[{"line_number":224,"context_line":"            if self.defer_refresh_firewall:"},{"line_number":225,"context_line":"                # Provider rule(for example, iptables rule to allow ingress"},{"line_number":226,"context_line":"                # packet from the dhcp server) updated. All local devices"},{"line_number":227,"context_line":"                # have to reload iptables."},{"line_number":228,"context_line":"                if devices and self.use_enhanced_rpc:"},{"line_number":229,"context_line":"                    self.firewall.security_group_updated(\u0027sg_member\u0027, [],"},{"line_number":230,"context_line":"                                                         devices)"}],"source_content_type":"text/x-python","patch_set":12,"id":"da36d5c6_527afc88","line":227,"updated":"2017-02-24 16:51:56.000000000","message":"Modifying the provider rule behavior is a separate change. Let\u0027s avoid doing that in this patch.","commit_id":"e269845c49aef60a53392d52b0c6070309aab7cf"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"91a643f2f8657bff0b074803f932177c8495d3c5","unresolved":false,"context_lines":[{"line_number":224,"context_line":"            if self.defer_refresh_firewall:"},{"line_number":225,"context_line":"                # Provider rule(for example, iptables rule to allow ingress"},{"line_number":226,"context_line":"                # packet from the dhcp server) updated. All local devices"},{"line_number":227,"context_line":"                # have to reload iptables."},{"line_number":228,"context_line":"                if devices and self.use_enhanced_rpc:"},{"line_number":229,"context_line":"                    self.firewall.security_group_updated(\u0027sg_member\u0027, [],"},{"line_number":230,"context_line":"                                                         devices)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a30ddce_11a8998c","line":227,"in_reply_to":"da36d5c6_527afc88","updated":"2017-03-10 13:35:22.000000000","message":"done","commit_id":"e269845c49aef60a53392d52b0c6070309aab7cf"}]}
