)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"735c65c3402c93e78cc53130bcebbe2302d4259e","unresolved":false,"context_lines":[{"line_number":9,"context_line":"In some cases if ip_lib.IPWrapper.ensure_namespace() method"},{"line_number":10,"context_line":"is called more than once for same namespace in very short"},{"line_number":11,"context_line":"period of time it could raise error that \"File already exists\""},{"line_number":12,"context_line":"for second call of this method."},{"line_number":13,"context_line":"It happens often e.g. in fullstack tests."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This patch is changing way how ensure_namespace() method works"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"5f2577a7_50488e85","line":12,"updated":"2017-09-15 19:08:25.000000000","message":"It would be cool to explain the background of the issue (netlink protocol being unreliable, kernel handling requests in async mode...)","commit_id":"85e2dbd61487f46fe830b3b8cac269303e7e8577"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"d633e7678be529025bafb4de5b462f832b55b57a","unresolved":false,"context_lines":[{"line_number":9,"context_line":"In some cases if ip_lib.IPWrapper.ensure_namespace() method"},{"line_number":10,"context_line":"is called more than once for same namespace in very short"},{"line_number":11,"context_line":"period of time it could raise error that \"File already exists\""},{"line_number":12,"context_line":"for second call of this method."},{"line_number":13,"context_line":"It happens often e.g. in fullstack tests."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This patch is changing way how ensure_namespace() method works"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"5f2577a7_23481585","line":12,"in_reply_to":"5f2577a7_50488e85","updated":"2017-09-16 03:02:47.000000000","message":"Done","commit_id":"85e2dbd61487f46fe830b3b8cac269303e7e8577"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"735c65c3402c93e78cc53130bcebbe2302d4259e","unresolved":false,"context_lines":[{"line_number":16,"context_line":"to avoid raising ProcessExecutionError exception with this"},{"line_number":17,"context_line":"error message."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I1898426789c85ce1faa97665bfd47f1fa38ef727"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"5f2577a7_107566cb","line":19,"updated":"2017-09-15 19:08:25.000000000","message":"create a bug and mention it here","commit_id":"85e2dbd61487f46fe830b3b8cac269303e7e8577"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"d633e7678be529025bafb4de5b462f832b55b57a","unresolved":false,"context_lines":[{"line_number":16,"context_line":"to avoid raising ProcessExecutionError exception with this"},{"line_number":17,"context_line":"error message."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I1898426789c85ce1faa97665bfd47f1fa38ef727"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"5f2577a7_a3708509","line":19,"in_reply_to":"5f2577a7_107566cb","updated":"2017-09-16 03:02:47.000000000","message":"Done","commit_id":"85e2dbd61487f46fe830b3b8cac269303e7e8577"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"2c9a87372f78c3a81be631c13a84e2875d4655e8","unresolved":false,"context_lines":[{"line_number":14,"context_line":"Reason of such problem is in Netlink protocol which is used"},{"line_number":15,"context_line":"by iproute2 to communicate with kernel. This protocol, according"},{"line_number":16,"context_line":"to http://man7.org/linux/man-pages/man7/netlink.7.html is not"},{"line_number":17,"context_line":"reliable so it not guarentee when message will be delivered"},{"line_number":18,"context_line":"to kernel and when action will be really executed."},{"line_number":19,"context_line":"Because of that if on quite loaded host ensure_namespace() method"},{"line_number":20,"context_line":"would be executed twice it can leads to error described above."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"5f2577a7_c476e070","line":17,"range":{"start_line":17,"start_character":9,"end_line":17,"end_character":34},"updated":"2017-09-18 14:18:45.000000000","message":"so it is not guaranteed when the","commit_id":"6557100c08e3e7a685aab008afffe8459b081bd2"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7f6f2bcda6c64946f0c7d8076c9485f1a0fe2ea6","unresolved":false,"context_lines":[{"line_number":14,"context_line":"Reason of such problem is in Netlink protocol which is used"},{"line_number":15,"context_line":"by iproute2 to communicate with kernel. This protocol, according"},{"line_number":16,"context_line":"to http://man7.org/linux/man-pages/man7/netlink.7.html is not"},{"line_number":17,"context_line":"reliable so it not guarentee when message will be delivered"},{"line_number":18,"context_line":"to kernel and when action will be really executed."},{"line_number":19,"context_line":"Because of that if on quite loaded host ensure_namespace() method"},{"line_number":20,"context_line":"would be executed twice it can leads to error described above."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"ff5d4b2f_df19ae88","line":17,"range":{"start_line":17,"start_character":9,"end_line":17,"end_character":34},"in_reply_to":"5f2577a7_c476e070","updated":"2017-09-19 19:37:17.000000000","message":"Done","commit_id":"6557100c08e3e7a685aab008afffe8459b081bd2"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"2c9a87372f78c3a81be631c13a84e2875d4655e8","unresolved":false,"context_lines":[{"line_number":17,"context_line":"reliable so it not guarentee when message will be delivered"},{"line_number":18,"context_line":"to kernel and when action will be really executed."},{"line_number":19,"context_line":"Because of that if on quite loaded host ensure_namespace() method"},{"line_number":20,"context_line":"would be executed twice it can leads to error described above."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"This patch is changing way how ensure_namespace() method works"},{"line_number":23,"context_line":"to avoid raising ProcessExecutionError exception with this"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"5f2577a7_040e28e4","line":20,"range":{"start_line":20,"start_character":30,"end_line":20,"end_character":36},"updated":"2017-09-18 14:18:45.000000000","message":"lead","commit_id":"6557100c08e3e7a685aab008afffe8459b081bd2"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7f6f2bcda6c64946f0c7d8076c9485f1a0fe2ea6","unresolved":false,"context_lines":[{"line_number":17,"context_line":"reliable so it not guarentee when message will be delivered"},{"line_number":18,"context_line":"to kernel and when action will be really executed."},{"line_number":19,"context_line":"Because of that if on quite loaded host ensure_namespace() method"},{"line_number":20,"context_line":"would be executed twice it can leads to error described above."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"This patch is changing way how ensure_namespace() method works"},{"line_number":23,"context_line":"to avoid raising ProcessExecutionError exception with this"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"ff5d4b2f_bf1efa6d","line":20,"range":{"start_line":20,"start_character":30,"end_line":20,"end_character":36},"in_reply_to":"5f2577a7_040e28e4","updated":"2017-09-19 19:37:17.000000000","message":"Done","commit_id":"6557100c08e3e7a685aab008afffe8459b081bd2"}],"neutron/agent/linux/ip_lib.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f8a9f67ad2b2b5b741cc931eee8b99bb2b9912f9","unresolved":false,"context_lines":[{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def ensure_namespace(self, name):"},{"line_number":206,"context_line":"        try:"},{"line_number":207,"context_line":"            self.netns.log_fail_as_error \u003d False"},{"line_number":208,"context_line":"            ip \u003d self.netns.add(name)"},{"line_number":209,"context_line":"        except linux_utils.ProcessExecutionError:"},{"line_number":210,"context_line":"            if self.netns.exists(name):"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f2577a7_75e7fcad","line":207,"updated":"2017-09-15 17:59:35.000000000","message":"This has to save what log_fail_as_error is now, then restore it.  See the IPDevice class exists() function - it saves the original and restores for a similar reason.","commit_id":"5bbfcc13a0f093aaf24c6a72013b3034eeec81ab"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"1645271f53fdb4917a6e2520af2407adad1f6e28","unresolved":false,"context_lines":[{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def ensure_namespace(self, name):"},{"line_number":206,"context_line":"        try:"},{"line_number":207,"context_line":"            self.netns.log_fail_as_error \u003d False"},{"line_number":208,"context_line":"            ip \u003d self.netns.add(name)"},{"line_number":209,"context_line":"        except linux_utils.ProcessExecutionError:"},{"line_number":210,"context_line":"            if self.netns.exists(name):"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f2577a7_d0d47eeb","line":207,"in_reply_to":"5f2577a7_75e7fcad","updated":"2017-09-15 18:50:19.000000000","message":"Done","commit_id":"5bbfcc13a0f093aaf24c6a72013b3034eeec81ab"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"6e3bb72ddb0e482089c7b8fa127aee136f0b7149","unresolved":false,"context_lines":[{"line_number":205,"context_line":"    def ensure_namespace(self, name):"},{"line_number":206,"context_line":"        try:"},{"line_number":207,"context_line":"            self.netns.log_fail_as_error \u003d False"},{"line_number":208,"context_line":"            ip \u003d self.netns.add(name)"},{"line_number":209,"context_line":"        except linux_utils.ProcessExecutionError:"},{"line_number":210,"context_line":"            if self.netns.exists(name):"},{"line_number":211,"context_line":"                # NOTE(slaweq): error which was catched here might be actually"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f2577a7_500bee22","line":208,"updated":"2017-09-15 18:07:05.000000000","message":"Ditto!","commit_id":"5bbfcc13a0f093aaf24c6a72013b3034eeec81ab"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"735c65c3402c93e78cc53130bcebbe2302d4259e","unresolved":false,"context_lines":[{"line_number":205,"context_line":"    def ensure_namespace(self, name):"},{"line_number":206,"context_line":"        try:"},{"line_number":207,"context_line":"            # we must save and restore this before returning"},{"line_number":208,"context_line":"            orig_log_fail_as_error \u003d self.get_log_fail_as_error()"},{"line_number":209,"context_line":"            self.set_log_fail_as_error(False)"},{"line_number":210,"context_line":"            ip \u003d self.netns.add(name)"},{"line_number":211,"context_line":"        except linux_utils.ProcessExecutionError:"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f2577a7_b01b327f","line":208,"updated":"2017-09-15 19:08:25.000000000","message":"this seems raceful. if two threads happen to execute the method, you can get the following:\n\n0. assume fail_as_error \u003d True\n1. threadA saves value as True\n2. threadA sets value to False\n3. threadB saves value as False\n4. threadB sets value to False\n5. threadA restores value to True\n6. threadB restores value to False\n\nEnd result: the value is now False though we started with True.\n\nIf you ask how it could happen, any i/o call like netns.add may yield to another green thread.","commit_id":"85e2dbd61487f46fe830b3b8cac269303e7e8577"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"3cfa84bf77217907925f1333f4f46ae64d9ce3cc","unresolved":false,"context_lines":[{"line_number":205,"context_line":"    def ensure_namespace(self, name):"},{"line_number":206,"context_line":"        try:"},{"line_number":207,"context_line":"            # we must save and restore this before returning"},{"line_number":208,"context_line":"            orig_log_fail_as_error \u003d self.get_log_fail_as_error()"},{"line_number":209,"context_line":"            self.set_log_fail_as_error(False)"},{"line_number":210,"context_line":"            ip \u003d self.netns.add(name)"},{"line_number":211,"context_line":"        except linux_utils.ProcessExecutionError:"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff5d4b2f_f6682522","line":208,"in_reply_to":"5f2577a7_235ed575","updated":"2017-09-19 14:07:02.000000000","message":"I would suggest to change SubProcessBase._run and SubProcessBase._as_root so that the value of log_fail_as_error passed to _execute would be self.log_fail_as_error by default, but could be overriden thanks to a new parameter to these two functions.\n\nThen you modify IpCommandBase to accept a log_fail_as_error parameter at __init__ and pass it to _parent._run and _parent._as_root.\n\nAnd then, in ensure namespace, instead of reusing self.netns, you instantiate a new IpNetnsCommand with log_fail_as_error to False.","commit_id":"85e2dbd61487f46fe830b3b8cac269303e7e8577"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"d633e7678be529025bafb4de5b462f832b55b57a","unresolved":false,"context_lines":[{"line_number":205,"context_line":"    def ensure_namespace(self, name):"},{"line_number":206,"context_line":"        try:"},{"line_number":207,"context_line":"            # we must save and restore this before returning"},{"line_number":208,"context_line":"            orig_log_fail_as_error \u003d self.get_log_fail_as_error()"},{"line_number":209,"context_line":"            self.set_log_fail_as_error(False)"},{"line_number":210,"context_line":"            ip \u003d self.netns.add(name)"},{"line_number":211,"context_line":"        except linux_utils.ProcessExecutionError:"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f2577a7_235ed575","line":208,"in_reply_to":"5f2577a7_b01b327f","updated":"2017-09-16 03:02:47.000000000","message":"You\u0027re right but do You have any idea how to solve this issue maybe? I know that I can use lock but it\u0027s IMO not the best solution because it might have little impact on performance also.","commit_id":"85e2dbd61487f46fe830b3b8cac269303e7e8577"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7f6f2bcda6c64946f0c7d8076c9485f1a0fe2ea6","unresolved":false,"context_lines":[{"line_number":205,"context_line":"    def ensure_namespace(self, name):"},{"line_number":206,"context_line":"        try:"},{"line_number":207,"context_line":"            # we must save and restore this before returning"},{"line_number":208,"context_line":"            orig_log_fail_as_error \u003d self.get_log_fail_as_error()"},{"line_number":209,"context_line":"            self.set_log_fail_as_error(False)"},{"line_number":210,"context_line":"            ip \u003d self.netns.add(name)"},{"line_number":211,"context_line":"        except linux_utils.ProcessExecutionError:"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff5d4b2f_6212255b","line":208,"in_reply_to":"ff5d4b2f_f6682522","updated":"2017-09-19 19:37:17.000000000","message":"Yes, I can do it like that and it should then work properly. I will do it in new patch then. Thx","commit_id":"85e2dbd61487f46fe830b3b8cac269303e7e8577"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"735c65c3402c93e78cc53130bcebbe2302d4259e","unresolved":false,"context_lines":[{"line_number":212,"context_line":"            if self.netns.exists(name):"},{"line_number":213,"context_line":"                # NOTE(slaweq): error which was catched here might be actually"},{"line_number":214,"context_line":"                # because of namespace already exists, in such case it\u0027s not"},{"line_number":215,"context_line":"                # an real issue"},{"line_number":216,"context_line":"                return IPWrapper(namespace\u003dname)"},{"line_number":217,"context_line":"            raise"},{"line_number":218,"context_line":"        finally:"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f2577a7_9b05f713","line":215,"range":{"start_line":215,"start_character":18,"end_line":215,"end_character":20},"updated":"2017-09-15 19:08:25.000000000","message":"a","commit_id":"85e2dbd61487f46fe830b3b8cac269303e7e8577"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"d633e7678be529025bafb4de5b462f832b55b57a","unresolved":false,"context_lines":[{"line_number":212,"context_line":"            if self.netns.exists(name):"},{"line_number":213,"context_line":"                # NOTE(slaweq): error which was catched here might be actually"},{"line_number":214,"context_line":"                # because of namespace already exists, in such case it\u0027s not"},{"line_number":215,"context_line":"                # an real issue"},{"line_number":216,"context_line":"                return IPWrapper(namespace\u003dname)"},{"line_number":217,"context_line":"            raise"},{"line_number":218,"context_line":"        finally:"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f2577a7_83634942","line":215,"range":{"start_line":215,"start_character":18,"end_line":215,"end_character":20},"in_reply_to":"5f2577a7_9b05f713","updated":"2017-09-16 03:02:47.000000000","message":"Done","commit_id":"85e2dbd61487f46fe830b3b8cac269303e7e8577"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"735c65c3402c93e78cc53130bcebbe2302d4259e","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        finally:"},{"line_number":219,"context_line":"            self.set_log_fail_as_error(orig_log_fail_as_error)"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"        lo \u003d ip.device(LOOPBACK_DEVNAME)"},{"line_number":222,"context_line":"        lo.link.set_up()"},{"line_number":223,"context_line":"        return ip"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    def namespace_is_empty(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f2577a7_5b0b0f23","line":222,"range":{"start_line":221,"start_character":8,"end_line":222,"end_character":24},"updated":"2017-09-15 19:08:25.000000000","message":"shouldn\u0027t we still up the device before returning in line 216? otherwise you potentially return a namespace that is not ready.","commit_id":"85e2dbd61487f46fe830b3b8cac269303e7e8577"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"d633e7678be529025bafb4de5b462f832b55b57a","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        finally:"},{"line_number":219,"context_line":"            self.set_log_fail_as_error(orig_log_fail_as_error)"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"        lo \u003d ip.device(LOOPBACK_DEVNAME)"},{"line_number":222,"context_line":"        lo.link.set_up()"},{"line_number":223,"context_line":"        return ip"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    def namespace_is_empty(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f2577a7_637f3de0","line":222,"range":{"start_line":221,"start_character":8,"end_line":222,"end_character":24},"in_reply_to":"5f2577a7_5b0b0f23","updated":"2017-09-16 03:02:47.000000000","message":"I don\u0027t think so. First of all it was done in same way before I did this patch and second: when this function is called and namespace really not exists than it\u0027s set up for sure, if if get into L216 it means that namespace was already ready.","commit_id":"85e2dbd61487f46fe830b3b8cac269303e7e8577"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"843582346cf3de4c3303f3df36e65d26a6421262","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        finally:"},{"line_number":219,"context_line":"            self.set_log_fail_as_error(orig_log_fail_as_error)"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"        lo \u003d ip.device(LOOPBACK_DEVNAME)"},{"line_number":222,"context_line":"        lo.link.set_up()"},{"line_number":223,"context_line":"        return ip"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    def namespace_is_empty(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff5d4b2f_22b8ad28","line":222,"range":{"start_line":221,"start_character":8,"end_line":222,"end_character":24},"in_reply_to":"5f2577a7_637f3de0","updated":"2017-09-19 19:43:01.000000000","message":"Could be that the namespace was just created by another thread, and we return to the caller before that other thread actually upped the loopback device. But I agree the issue was present before.","commit_id":"85e2dbd61487f46fe830b3b8cac269303e7e8577"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"271b52efccc5a89c1f36b08ad104417f150c5006","unresolved":false,"context_lines":[{"line_number":206,"context_line":"        try:"},{"line_number":207,"context_line":"            # we must save and restore this before returning"},{"line_number":208,"context_line":"            orig_log_fail_as_error \u003d self.get_log_fail_as_error()"},{"line_number":209,"context_line":"            self.set_log_fail_as_error(False)"},{"line_number":210,"context_line":"            ip \u003d self.netns.add(name)"},{"line_number":211,"context_line":"        except linux_utils.ProcessExecutionError:"},{"line_number":212,"context_line":"            if self.netns.exists(name):"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f2577a7_9ba177fb","line":209,"updated":"2017-09-15 19:25:28.000000000","message":"Above can be outside the try block","commit_id":"94dcd5f7c37abb21c03e4b87df9d1788e315590d"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"65925c4ddf34f3fec6794344cf7617ab2c256476","unresolved":false,"context_lines":[{"line_number":206,"context_line":"        try:"},{"line_number":207,"context_line":"            # we must save and restore this before returning"},{"line_number":208,"context_line":"            orig_log_fail_as_error \u003d self.get_log_fail_as_error()"},{"line_number":209,"context_line":"            self.set_log_fail_as_error(False)"},{"line_number":210,"context_line":"            ip \u003d self.netns.add(name)"},{"line_number":211,"context_line":"        except linux_utils.ProcessExecutionError:"},{"line_number":212,"context_line":"            if self.netns.exists(name):"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f2577a7_c3739115","line":209,"in_reply_to":"5f2577a7_9ba177fb","updated":"2017-09-16 03:03:02.000000000","message":"Done","commit_id":"94dcd5f7c37abb21c03e4b87df9d1788e315590d"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"271b52efccc5a89c1f36b08ad104417f150c5006","unresolved":false,"context_lines":[{"line_number":213,"context_line":"                # NOTE(slaweq): error which was catched here might be actually"},{"line_number":214,"context_line":"                # because of namespace already exists, in such case it\u0027s not"},{"line_number":215,"context_line":"                # an real issue"},{"line_number":216,"context_line":"                return IPWrapper(namespace\u003dname)"},{"line_number":217,"context_line":"            raise"},{"line_number":218,"context_line":"        finally:"},{"line_number":219,"context_line":"            self.set_log_fail_as_error(orig_log_fail_as_error)"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f2577a7_5b5c2fec","line":216,"updated":"2017-09-15 19:25:28.000000000","message":"In this case we might return before lo has been brought up by the other thread.   To be safe can probably do:\n\nif not self.netns.exists(name):\n    raise\nip \u003d IPWrapper(namespace\u003dname)\n\nthen it will fall through and up the device a second time.\n\nBut then maybe it doesn\u0027t even matter since the callers only need the namespace to exist.  So maybe just ignore this comment :)","commit_id":"94dcd5f7c37abb21c03e4b87df9d1788e315590d"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"65925c4ddf34f3fec6794344cf7617ab2c256476","unresolved":false,"context_lines":[{"line_number":213,"context_line":"                # NOTE(slaweq): error which was catched here might be actually"},{"line_number":214,"context_line":"                # because of namespace already exists, in such case it\u0027s not"},{"line_number":215,"context_line":"                # an real issue"},{"line_number":216,"context_line":"                return IPWrapper(namespace\u003dname)"},{"line_number":217,"context_line":"            raise"},{"line_number":218,"context_line":"        finally:"},{"line_number":219,"context_line":"            self.set_log_fail_as_error(orig_log_fail_as_error)"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f2577a7_e36a0d18","line":216,"in_reply_to":"5f2577a7_5b5c2fec","updated":"2017-09-16 03:03:02.000000000","message":"but than it will try to make lo device up every time this method will be called, even if namespace exists already for long time.\nI wanted to change as little logic as it\u0027s possible in this function so I wanted to call to set lo up only if namespace really was not created yet.","commit_id":"94dcd5f7c37abb21c03e4b87df9d1788e315590d"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"843582346cf3de4c3303f3df36e65d26a6421262","unresolved":false,"context_lines":[{"line_number":210,"context_line":"            ip \u003d self.netns.add(name)"},{"line_number":211,"context_line":"        except linux_utils.ProcessExecutionError:"},{"line_number":212,"context_line":"            if self.netns.exists(name):"},{"line_number":213,"context_line":"                # NOTE(slaweq): error which was catched here might be actually"},{"line_number":214,"context_line":"                # because of namespace already exists, in such case it\u0027s not"},{"line_number":215,"context_line":"                # a real issue"},{"line_number":216,"context_line":"                return IPWrapper(namespace\u003dname)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff5d4b2f_4294c18b","line":213,"range":{"start_line":213,"start_character":48,"end_line":213,"end_character":55},"updated":"2017-09-19 19:43:01.000000000","message":"caught","commit_id":"fd1403fd9a971cf3cbd863fa33ca68eb019fbdc1"}],"neutron/tests/functional/agent/linux/test_ip_lib.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"735c65c3402c93e78cc53130bcebbe2302d4259e","unresolved":false,"context_lines":[{"line_number":191,"context_line":"        self.assertEqual(attr.namespace, ip.namespace)"},{"line_number":192,"context_line":"        self.assertTrue(ip.netns.exists(attr.namespace))"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"        # Now trying to create same namespace second time, should be no error"},{"line_number":195,"context_line":"        ip2 \u003d ip_lib.IPWrapper().ensure_namespace(attr.namespace)"},{"line_number":196,"context_line":"        self.assertEqual(attr.namespace, ip2.namespace)"},{"line_number":197,"context_line":"        self.assertTrue(ip2.netns.exists(attr.namespace))"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f2577a7_9b53b717","line":194,"updated":"2017-09-15 19:08:25.000000000","message":"I believe to raise the chance of hitting a failure, you should decrease the time between calls to the minimum. Consider calling line 195 right after 190. Also, you could save some more miliseconds if you would reuse/prepare IPWrapper objects to avoid __init__ calls.","commit_id":"85e2dbd61487f46fe830b3b8cac269303e7e8577"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"d633e7678be529025bafb4de5b462f832b55b57a","unresolved":false,"context_lines":[{"line_number":191,"context_line":"        self.assertEqual(attr.namespace, ip.namespace)"},{"line_number":192,"context_line":"        self.assertTrue(ip.netns.exists(attr.namespace))"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"        # Now trying to create same namespace second time, should be no error"},{"line_number":195,"context_line":"        ip2 \u003d ip_lib.IPWrapper().ensure_namespace(attr.namespace)"},{"line_number":196,"context_line":"        self.assertEqual(attr.namespace, ip2.namespace)"},{"line_number":197,"context_line":"        self.assertTrue(ip2.netns.exists(attr.namespace))"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f2577a7_63cdfd2f","line":194,"in_reply_to":"5f2577a7_9b53b717","updated":"2017-09-16 03:02:47.000000000","message":"Done","commit_id":"85e2dbd61487f46fe830b3b8cac269303e7e8577"}]}
