)]}'
{"neutron/agent/linux/iptables_manager.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"f0366b96a1b6e66a7a29f6f7ed975949f4b83f4a","unresolved":false,"context_lines":[{"line_number":523,"context_line":"                # 999eaa241212d3952ddff39a99d0d55a74e3639e (for example, latest"},{"line_number":524,"context_line":"                # RHEL) and failed because of xlock acquired by another"},{"line_number":525,"context_line":"                # iptables process running in parallel. Try to use -w to"},{"line_number":526,"context_line":"                # acquire xlock. If iptables also include"},{"line_number":527,"context_line":"                # d89dc47ab3875f6fe6679cebceccd2000bf81b8e, then it will fail"},{"line_number":528,"context_line":"                # with unknown argument error; otherwise it will ignore the"},{"line_number":529,"context_line":"                # argument and proceed with rule execution."}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_74b52e31","line":526,"updated":"2017-08-23 17:32:48.000000000","message":"this comment is a bit misleading; need to reword","commit_id":"fb90e652e1fa5578cda7e613bd7e2fbd33cafdc9"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"1636a4e7f4df10f7863146978dbe80067b3f7307","unresolved":false,"context_lines":[{"line_number":529,"context_line":"                # argument and proceed with rule execution."},{"line_number":530,"context_line":"                try:"},{"line_number":531,"context_line":"                    self.execute("},{"line_number":532,"context_line":"                        args + [\u0027-w\u0027], process_input\u003d\u0027\\n\u0027.join(commands),"},{"line_number":533,"context_line":"                        run_as_root\u003dTrue)"},{"line_number":534,"context_line":"                except RuntimeError as r_error:"},{"line_number":535,"context_line":"                    with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f436f4f_7d8de3d1","line":532,"range":{"start_line":532,"start_character":32,"end_line":532,"end_character":36},"updated":"2017-08-22 12:24:03.000000000","message":"We should probably pass some sane timeout value to not block the agents in case something goes south with the iptables lock.","commit_id":"fb90e652e1fa5578cda7e613bd7e2fbd33cafdc9"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bd1904e311436d5823968a25894729cb7cee0181","unresolved":false,"context_lines":[{"line_number":529,"context_line":"                # argument and proceed with rule execution."},{"line_number":530,"context_line":"                try:"},{"line_number":531,"context_line":"                    self.execute("},{"line_number":532,"context_line":"                        args + [\u0027-w\u0027], process_input\u003d\u0027\\n\u0027.join(commands),"},{"line_number":533,"context_line":"                        run_as_root\u003dTrue)"},{"line_number":534,"context_line":"                except RuntimeError as r_error:"},{"line_number":535,"context_line":"                    with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_55bb3e71","line":532,"range":{"start_line":532,"start_character":32,"end_line":532,"end_character":36},"in_reply_to":"7f287b81_b466f6ec","updated":"2017-08-24 09:07:29.000000000","message":"I was thinking about something like agent.report_interval / 3.0 \u003d\u003e therefore agents will still have some time to finish other stuff and agent won\u0027t be considered dead by server and will avoid expensive full-sync.","commit_id":"fb90e652e1fa5578cda7e613bd7e2fbd33cafdc9"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e94ad2dfc98b02d4d90d6357c6e03ab4ad05ea34","unresolved":false,"context_lines":[{"line_number":529,"context_line":"                # argument and proceed with rule execution."},{"line_number":530,"context_line":"                try:"},{"line_number":531,"context_line":"                    self.execute("},{"line_number":532,"context_line":"                        args + [\u0027-w\u0027], process_input\u003d\u0027\\n\u0027.join(commands),"},{"line_number":533,"context_line":"                        run_as_root\u003dTrue)"},{"line_number":534,"context_line":"                except RuntimeError as r_error:"},{"line_number":535,"context_line":"                    with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_b466f6ec","line":532,"range":{"start_line":532,"start_character":32,"end_line":532,"end_character":36},"in_reply_to":"9f436f4f_7d8de3d1","updated":"2017-08-23 17:31:04.000000000","message":"What would this value be?","commit_id":"fb90e652e1fa5578cda7e613bd7e2fbd33cafdc9"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"ec59db523b9770a24ff309a91e4e9e6208d52bcb","unresolved":false,"context_lines":[{"line_number":457,"context_line":"            args \u003d [\u0027ip\u0027, \u0027netns\u0027, \u0027exec\u0027, self.namespace] + args"},{"line_number":458,"context_line":"        return self.execute(args, run_as_root\u003dTrue).split(\u0027\\n\u0027)"},{"line_number":459,"context_line":""},{"line_number":460,"context_line":"    def _get_iptables_xlock_wait_time(self):"},{"line_number":461,"context_line":"        # give agent some time to report back to server"},{"line_number":462,"context_line":"        return str(int(cfg.CONF.AGENT.report_interval / 3.0))"},{"line_number":463,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_d5fb6076","line":460,"range":{"start_line":460,"start_character":0,"end_line":460,"end_character":44},"updated":"2017-08-28 09:03:47.000000000","message":"supernit: If this would be a property you could use it right away in args for execute method. e.g.\n\n @property\n def xlock_wait_time(self):\n     ...\n\non L534:\n\n args + [\u0027-w\u0027, self.xlock_wait_time]","commit_id":"b18ecf602e8e6abae6602f5090da0a59f5eab467"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6f18d199ee5bd6f11deadad2d58e1f8f66e8d33d","unresolved":false,"context_lines":[{"line_number":457,"context_line":"            args \u003d [\u0027ip\u0027, \u0027netns\u0027, \u0027exec\u0027, self.namespace] + args"},{"line_number":458,"context_line":"        return self.execute(args, run_as_root\u003dTrue).split(\u0027\\n\u0027)"},{"line_number":459,"context_line":""},{"line_number":460,"context_line":"    def _get_iptables_xlock_wait_time(self):"},{"line_number":461,"context_line":"        # give agent some time to report back to server"},{"line_number":462,"context_line":"        return str(int(cfg.CONF.AGENT.report_interval / 3.0))"},{"line_number":463,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_2bd8d178","line":460,"range":{"start_line":460,"start_character":0,"end_line":460,"end_character":44},"in_reply_to":"7f287b81_d5fb6076","updated":"2017-08-29 21:24:15.000000000","message":"Done","commit_id":"b18ecf602e8e6abae6602f5090da0a59f5eab467"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"ec59db523b9770a24ff309a91e4e9e6208d52bcb","unresolved":false,"context_lines":[{"line_number":522,"context_line":"                commands.append(\u0027\u0027)"},{"line_number":523,"context_line":"                self.execute(args, process_input\u003d\u0027\\n\u0027.join(commands),"},{"line_number":524,"context_line":"                             run_as_root\u003dTrue)"},{"line_number":525,"context_line":"            except RuntimeError:"},{"line_number":526,"context_line":"                # maybe we run on a platform that includes iptables commit"},{"line_number":527,"context_line":"                # 999eaa241212d3952ddff39a99d0d55a74e3639e (for example, latest"},{"line_number":528,"context_line":"                # RHEL) and failed because of xlock acquired by another"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_20e4a0e0","line":525,"range":{"start_line":525,"start_character":19,"end_line":525,"end_character":31},"updated":"2017-08-28 09:03:47.000000000","message":"Would be worth to log this error in debug level in case it\u0027s not the xlock that we expect.","commit_id":"b18ecf602e8e6abae6602f5090da0a59f5eab467"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"baf9a44b32f26ae9c460be5e7ab813268a139008","unresolved":false,"context_lines":[{"line_number":522,"context_line":"                commands.append(\u0027\u0027)"},{"line_number":523,"context_line":"                self.execute(args, process_input\u003d\u0027\\n\u0027.join(commands),"},{"line_number":524,"context_line":"                             run_as_root\u003dTrue)"},{"line_number":525,"context_line":"            except RuntimeError:"},{"line_number":526,"context_line":"                # maybe we run on a platform that includes iptables commit"},{"line_number":527,"context_line":"                # 999eaa241212d3952ddff39a99d0d55a74e3639e (for example, latest"},{"line_number":528,"context_line":"                # RHEL) and failed because of xlock acquired by another"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_487227af","line":525,"range":{"start_line":525,"start_character":19,"end_line":525,"end_character":31},"in_reply_to":"7f287b81_20e4a0e0","updated":"2017-08-28 17:30:29.000000000","message":"I then expect it to fail the second time, at which point we will log an error, no?","commit_id":"b18ecf602e8e6abae6602f5090da0a59f5eab467"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6f18d199ee5bd6f11deadad2d58e1f8f66e8d33d","unresolved":false,"context_lines":[{"line_number":522,"context_line":"                commands.append(\u0027\u0027)"},{"line_number":523,"context_line":"                self.execute(args, process_input\u003d\u0027\\n\u0027.join(commands),"},{"line_number":524,"context_line":"                             run_as_root\u003dTrue)"},{"line_number":525,"context_line":"            except RuntimeError:"},{"line_number":526,"context_line":"                # maybe we run on a platform that includes iptables commit"},{"line_number":527,"context_line":"                # 999eaa241212d3952ddff39a99d0d55a74e3639e (for example, latest"},{"line_number":528,"context_line":"                # RHEL) and failed because of xlock acquired by another"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_7d446047","line":525,"range":{"start_line":525,"start_character":19,"end_line":525,"end_character":31},"in_reply_to":"7f287b81_2546cec1","updated":"2017-08-29 21:24:15.000000000","message":"OK, I will check return code. I will not log the first and second error if it was xlock the first time.","commit_id":"b18ecf602e8e6abae6602f5090da0a59f5eab467"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a1c7b5f9a0a456049c69c4762b8b7ccc1245f54a","unresolved":false,"context_lines":[{"line_number":522,"context_line":"                commands.append(\u0027\u0027)"},{"line_number":523,"context_line":"                self.execute(args, process_input\u003d\u0027\\n\u0027.join(commands),"},{"line_number":524,"context_line":"                             run_as_root\u003dTrue)"},{"line_number":525,"context_line":"            except RuntimeError:"},{"line_number":526,"context_line":"                # maybe we run on a platform that includes iptables commit"},{"line_number":527,"context_line":"                # 999eaa241212d3952ddff39a99d0d55a74e3639e (for example, latest"},{"line_number":528,"context_line":"                # RHEL) and failed because of xlock acquired by another"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_64d29c02","line":525,"range":{"start_line":525,"start_character":19,"end_line":525,"end_character":31},"in_reply_to":"7f287b81_487227af","updated":"2017-08-29 09:03:56.000000000","message":"We will log an error but not the error, the failure from L533 can be different than the one from L523.","commit_id":"b18ecf602e8e6abae6602f5090da0a59f5eab467"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"6e4b3e8778c34bbdaa2d7cf0cd8bd050e151f90f","unresolved":false,"context_lines":[{"line_number":522,"context_line":"                commands.append(\u0027\u0027)"},{"line_number":523,"context_line":"                self.execute(args, process_input\u003d\u0027\\n\u0027.join(commands),"},{"line_number":524,"context_line":"                             run_as_root\u003dTrue)"},{"line_number":525,"context_line":"            except RuntimeError:"},{"line_number":526,"context_line":"                # maybe we run on a platform that includes iptables commit"},{"line_number":527,"context_line":"                # 999eaa241212d3952ddff39a99d0d55a74e3639e (for example, latest"},{"line_number":528,"context_line":"                # RHEL) and failed because of xlock acquired by another"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_2546cec1","line":525,"range":{"start_line":525,"start_character":19,"end_line":525,"end_character":31},"in_reply_to":"7f287b81_64d29c02","updated":"2017-08-29 11:10:46.000000000","message":"Can we retry only if return_code is \u00274\u0027?\n\nI see the below message when this error comes,\n\"neutron.agent.linux.utils.ProcessExecutionError: Exit code: 4; Stdin: # Generated by iptables_manager\"\n\n\nAnd this link https://unix.stackexchange.com/questions/363046/iptables-return-code-4/363051 says exit code 4 is for locks. May be we can check the return_code instead of all run time erros i.e https://github.com/openstack/neutron/blob/master/neutron/agent/linux/utils.py#L49\n\nOtherwise this code is fine(and hope L533 gives same error as L523 when executed again).","commit_id":"b18ecf602e8e6abae6602f5090da0a59f5eab467"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"ec933d4c84b1fe2d5529e98b03f31c171f2a2514","unresolved":false,"context_lines":[{"line_number":510,"context_line":"        if self.use_ipv6:"},{"line_number":511,"context_line":"            s +\u003d [(\u0027ip6tables\u0027, self.ipv6)]"},{"line_number":512,"context_line":"        all_commands \u003d []  # variable to keep track all commands for return val"},{"line_number":513,"context_line":""},{"line_number":514,"context_line":"        for cmd, tables in s:"},{"line_number":515,"context_line":"            args \u003d [\u0027%s-save\u0027 % (cmd,)]"},{"line_number":516,"context_line":"            if self.namespace:"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f287b81_4dbe87ff","line":513,"updated":"2017-08-30 07:11:24.000000000","message":"Unrelated","commit_id":"33efcfd66e9bd715d2503afbdde57c1277e1d2c4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"ec933d4c84b1fe2d5529e98b03f31c171f2a2514","unresolved":false,"context_lines":[{"line_number":560,"context_line":"                args \u003d [\u0027ip\u0027, \u0027netns\u0027, \u0027exec\u0027, self.namespace] + args"},{"line_number":561,"context_line":""},{"line_number":562,"context_line":"            err \u003d self._run_restore(args, commands)"},{"line_number":563,"context_line":"            if (err and"},{"line_number":564,"context_line":"                isinstance(err, linux_utils.ProcessExecutionError) and"},{"line_number":565,"context_line":"                err.returncode \u003d\u003d XTABLES_RESOURCE_PROBLEM_CODE):"},{"line_number":566,"context_line":"                # maybe we run on a platform that includes iptables commit"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f287b81_adf4cbf1","line":563,"range":{"start_line":563,"start_character":16,"end_line":563,"end_character":23},"updated":"2017-08-30 07:11:24.000000000","message":"This is not needed as if it would be None, it will be evaluated as False by isinstance","commit_id":"33efcfd66e9bd715d2503afbdde57c1277e1d2c4"}],"neutron/cmd/ipset_cleanup.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"ec59db523b9770a24ff309a91e4e9e6208d52bcb","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    if ipset in iptables_save:"},{"line_number":44,"context_line":"        cmd \u003d [\u0027iptables\u0027] if \u0027IPv4\u0027 in ipset else [\u0027ip6tables\u0027]"},{"line_number":45,"context_line":"        cmd +\u003d [\u0027-w\u0027, \u002710\u0027]  # wait for xlock release"},{"line_number":46,"context_line":"        LOG.info(\"Removing iptables rule for IPset: %s\", ipset)"},{"line_number":47,"context_line":"        for rule in iptables_save.splitlines():"},{"line_number":48,"context_line":"            if \u0027--match-set %s \u0027 % ipset in rule and rule.startswith(\u0027-A\u0027):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_c0403ca8","line":45,"updated":"2017-08-28 09:03:47.000000000","message":"How about those systems not supporting -w? Shouldn\u0027t we do the same as in iptables_manager, do without -w and if it fails, try -w?","commit_id":"b18ecf602e8e6abae6602f5090da0a59f5eab467"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"baf9a44b32f26ae9c460be5e7ab813268a139008","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    if ipset in iptables_save:"},{"line_number":44,"context_line":"        cmd \u003d [\u0027iptables\u0027] if \u0027IPv4\u0027 in ipset else [\u0027ip6tables\u0027]"},{"line_number":45,"context_line":"        cmd +\u003d [\u0027-w\u0027, \u002710\u0027]  # wait for xlock release"},{"line_number":46,"context_line":"        LOG.info(\"Removing iptables rule for IPset: %s\", ipset)"},{"line_number":47,"context_line":"        for rule in iptables_save.splitlines():"},{"line_number":48,"context_line":"            if \u0027--match-set %s \u0027 % ipset in rule and rule.startswith(\u0027-A\u0027):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_e860b3d1","line":45,"in_reply_to":"7f287b81_c0403ca8","updated":"2017-08-28 17:30:29.000000000","message":"iptables command supports -w for a very long time. it\u0027s iptables-restore that is new to -w.","commit_id":"b18ecf602e8e6abae6602f5090da0a59f5eab467"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a1c7b5f9a0a456049c69c4762b8b7ccc1245f54a","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    if ipset in iptables_save:"},{"line_number":44,"context_line":"        cmd \u003d [\u0027iptables\u0027] if \u0027IPv4\u0027 in ipset else [\u0027ip6tables\u0027]"},{"line_number":45,"context_line":"        cmd +\u003d [\u0027-w\u0027, \u002710\u0027]  # wait for xlock release"},{"line_number":46,"context_line":"        LOG.info(\"Removing iptables rule for IPset: %s\", ipset)"},{"line_number":47,"context_line":"        for rule in iptables_save.splitlines():"},{"line_number":48,"context_line":"            if \u0027--match-set %s \u0027 % ipset in rule and rule.startswith(\u0027-A\u0027):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_a4fd246f","line":45,"in_reply_to":"7f287b81_e860b3d1","updated":"2017-08-29 09:03:56.000000000","message":"Aha, thanks for clarification.","commit_id":"b18ecf602e8e6abae6602f5090da0a59f5eab467"}],"neutron/tests/unit/agent/linux/test_iptables_manager.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"ec59db523b9770a24ff309a91e4e9e6208d52bcb","unresolved":false,"context_lines":[{"line_number":375,"context_line":"        cfg.CONF.set_override(\u0027comment_iptables_rules\u0027, False, \u0027AGENT\u0027)"},{"line_number":376,"context_line":"        self.iptables \u003d iptables_manager.IptablesManager()"},{"line_number":377,"context_line":"        self.execute \u003d mock.patch.object(self.iptables, \"execute\").start()"},{"line_number":378,"context_line":""},{"line_number":379,"context_line":"    def test_binary_name(self):"},{"line_number":380,"context_line":"        expected \u003d os.path.basename(sys.argv[0])[:16]"},{"line_number":381,"context_line":"        self.assertEqual(expected, iptables_manager.binary_name)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_20694020","line":378,"updated":"2017-08-28 09:03:47.000000000","message":"Would be worth to override AGENT.report_interval config option to 30 so if somebody changes the default it won\u0027t cause surprising failure in iptables code.","commit_id":"b18ecf602e8e6abae6602f5090da0a59f5eab467"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6f18d199ee5bd6f11deadad2d58e1f8f66e8d33d","unresolved":false,"context_lines":[{"line_number":375,"context_line":"        cfg.CONF.set_override(\u0027comment_iptables_rules\u0027, False, \u0027AGENT\u0027)"},{"line_number":376,"context_line":"        self.iptables \u003d iptables_manager.IptablesManager()"},{"line_number":377,"context_line":"        self.execute \u003d mock.patch.object(self.iptables, \"execute\").start()"},{"line_number":378,"context_line":""},{"line_number":379,"context_line":"    def test_binary_name(self):"},{"line_number":380,"context_line":"        expected \u003d os.path.basename(sys.argv[0])[:16]"},{"line_number":381,"context_line":"        self.assertEqual(expected, iptables_manager.binary_name)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_1d40bc06","line":378,"in_reply_to":"7f287b81_20694020","updated":"2017-08-29 21:24:15.000000000","message":"Done","commit_id":"b18ecf602e8e6abae6602f5090da0a59f5eab467"}]}
