)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"7251592b0154e1d227356247d5802312094b990a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"43b590e6_5686b34f","updated":"2022-08-26 07:55:52.000000000","message":"Although this is a short patch, it deserves a release note (section \"issues\") describing why we can raise this specific exception and the behaviour of Nova in this case. It is important to have it described.\n\nBTW, good catch!","commit_id":"e1cb5080ef9d95a77fdc772d72396a973b0f90eb"},{"author":{"_account_id":31976,"name":"Bodo Petermann","email":"b.petermann@syseleven.de","username":"bpetermann"},"change_message_id":"5eb60f7077b0e36de135e7c27ac84351ce773212","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"cc8be369_ccb0d9e7","updated":"2022-08-23 15:43:20.000000000","message":"Resolved (I hope) with patch set 2","commit_id":"e1cb5080ef9d95a77fdc772d72396a973b0f90eb"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"b2af01456b4525f8142ed8f408d8f34598f67622","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"b99aed5b_0405fab0","updated":"2023-03-21 16:48:59.000000000","message":"Code is almost ready","commit_id":"399196a9df7e55626aa060d3d7b2214428fd2f64"},{"author":{"_account_id":31976,"name":"Bodo Petermann","email":"b.petermann@syseleven.de","username":"bpetermann"},"change_message_id":"bbe579770867b51eda05a2f4e46a1ce15cb0bf94","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"7603d673_e4947c08","updated":"2022-08-31 15:59:49.000000000","message":"recheck","commit_id":"399196a9df7e55626aa060d3d7b2214428fd2f64"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"538cdf64fd353f2ca097050c15003721a9f6f1bb","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"849e6a36_8785d67f","updated":"2023-03-22 11:25:48.000000000","message":"Hello Bodo. Let\u0027s discuss this approach during the PTG. This is indeed a problem in Neutron and you found the issue, the reproducer and a possible fix (thanks for that).\n\nHowever, we maybe need to return something different (not an exception) and make this call (port binding activation) idempotent. Let\u0027s discuss this during the PTG [1], next Thursday.\n\n[1]https://etherpad.opendev.org/p/neutron-bobcat-ptg","commit_id":"5b4ed5b117f2f418d598af20744f571db581e2ae"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"ada0505df2201c6920a22e5a9cc8d27281471378","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"fd6cc694_51235652","updated":"2023-04-03 08:45:49.000000000","message":"Thanks","commit_id":"5b4ed5b117f2f418d598af20744f571db581e2ae"},{"author":{"_account_id":31976,"name":"Bodo Petermann","email":"b.petermann@syseleven.de","username":"bpetermann"},"change_message_id":"fb978807dd10304f8c4345ba14cc4f6a67ebad0c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"5210b1ba_e000c824","updated":"2023-03-30 14:25:24.000000000","message":"recheck","commit_id":"5b4ed5b117f2f418d598af20744f571db581e2ae"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"5ff3fcb596c1de84250e3439a0b638b18b47ec4b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"020ca150_6791243e","updated":"2023-04-04 07:18:39.000000000","message":"recheck fullstack","commit_id":"5b4ed5b117f2f418d598af20744f571db581e2ae"},{"author":{"_account_id":21798,"name":"Bernard Cafarelli","email":"bcafarel@redhat.com","username":"bcafarel"},"change_message_id":"1246926c21912acf884cf6a15457a67f4de1aa59","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"719839ee_e51288ba","updated":"2023-04-05 14:08:17.000000000","message":"recheck fullstack gate","commit_id":"5b4ed5b117f2f418d598af20744f571db581e2ae"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"0e1a8c143187ed2996f858512bb35a54b7b4e6b0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"72b12765_183bad25","updated":"2023-04-03 16:15:06.000000000","message":"recheck grenade","commit_id":"5b4ed5b117f2f418d598af20744f571db581e2ae"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"f9b9fdba54c131fcec939b18e3a36ef4c7267ed9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"91800612_2ac297d8","updated":"2023-04-03 10:58:03.000000000","message":"recheck grenade (test reported in launchpad)","commit_id":"5b4ed5b117f2f418d598af20744f571db581e2ae"},{"author":{"_account_id":21798,"name":"Bernard Cafarelli","email":"bcafarel@redhat.com","username":"bcafarel"},"change_message_id":"efc1c7c6acae9658ac92f792820caa0baa7d0744","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"61c84465_fe2aecb8","updated":"2023-04-03 14:27:59.000000000","message":"recheck neutron-ovs-grenade-dvr-multinode","commit_id":"5b4ed5b117f2f418d598af20744f571db581e2ae"},{"author":{"_account_id":31976,"name":"Bodo Petermann","email":"b.petermann@syseleven.de","username":"bpetermann"},"change_message_id":"592da18bea148e693d159c2b0c396dcbb90a5296","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"e51caaef_6fe19fa6","in_reply_to":"849e6a36_8785d67f","updated":"2023-03-22 12:23:05.000000000","message":"ok, I will be there","commit_id":"5b4ed5b117f2f418d598af20744f571db581e2ae"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"d5a25904f7d8501bfc280ce7f52f48137b23ea56","unresolved":true,"context_lines":[{"line_number":717,"context_line":"                        host\u003dnew_binding.host))"},{"line_number":718,"context_line":"                # the INACTIVE binding row might be gone if there was a"},{"line_number":719,"context_line":"                # concurrent request to activate it"},{"line_number":720,"context_line":"                if cur_context_binding is None:"},{"line_number":721,"context_line":"                    raise exc.PortBindingAlreadyActive(port_id\u003dport_id,"},{"line_number":722,"context_line":"                                                       host\u003dnew_binding.host)"},{"line_number":723,"context_line":"            cur_context \u003d driver_context.PortContext("},{"line_number":724,"context_line":"                self, plugin_context, port, network, cur_context_binding, None,"},{"line_number":725,"context_line":"                original_port\u003doport)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7b026088_a7a2ee6c","line":722,"range":{"start_line":720,"start_character":16,"end_line":722,"end_character":77},"updated":"2022-08-16 15:00:20.000000000","message":"This is not true, or at least we can\u0027t imply this. In this situation, the only thing we can raise is \"PortBindingNotFound\", that is the exception raised from \"get_port_binding_by_status_and_host\" when raise_if_not_found\u003dTrue.\n\nThis race condition could happen just between this DB txn and the previous one; actually during the previous DB txn we check that [1].\n\n\n[1]https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/plugin.py#L2748-L2751","commit_id":"539bf3d3e9e51f5e2b1a48c30d93ae3804674209"},{"author":{"_account_id":31976,"name":"Bodo Petermann","email":"b.petermann@syseleven.de","username":"bpetermann"},"change_message_id":"266aad2e60cc70716b3a6653c6f41529eed4a46c","unresolved":true,"context_lines":[{"line_number":717,"context_line":"                        host\u003dnew_binding.host))"},{"line_number":718,"context_line":"                # the INACTIVE binding row might be gone if there was a"},{"line_number":719,"context_line":"                # concurrent request to activate it"},{"line_number":720,"context_line":"                if cur_context_binding is None:"},{"line_number":721,"context_line":"                    raise exc.PortBindingAlreadyActive(port_id\u003dport_id,"},{"line_number":722,"context_line":"                                                       host\u003dnew_binding.host)"},{"line_number":723,"context_line":"            cur_context \u003d driver_context.PortContext("},{"line_number":724,"context_line":"                self, plugin_context, port, network, cur_context_binding, None,"},{"line_number":725,"context_line":"                original_port\u003doport)"}],"source_content_type":"text/x-python","patch_set":1,"id":"8a6f3836_61af2440","line":722,"range":{"start_line":720,"start_character":16,"end_line":722,"end_character":77},"in_reply_to":"7b026088_a7a2ee6c","updated":"2022-08-16 15:56:03.000000000","message":"I changed it and let it raise PortBindingNotFound at this place. I still added a check if the to-be-activated binding is already active, so that it will raise a PortBindingAlreadyActive there. The resulting Conflict/409 will be handled by nova more gracefully than a 404.","commit_id":"539bf3d3e9e51f5e2b1a48c30d93ae3804674209"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"7251592b0154e1d227356247d5802312094b990a","unresolved":true,"context_lines":[{"line_number":726,"context_line":"                    p_utils.get_port_binding_by_status_and_host("},{"line_number":727,"context_line":"                        port_db.port_bindings, const.INACTIVE,"},{"line_number":728,"context_line":"                        host\u003dnew_binding.host,"},{"line_number":729,"context_line":"                        raise_if_not_found\u003dTrue))"},{"line_number":730,"context_line":"            cur_context \u003d driver_context.PortContext("},{"line_number":731,"context_line":"                self, plugin_context, port, network, cur_context_binding, None,"},{"line_number":732,"context_line":"                original_port\u003doport)"}],"source_content_type":"text/x-python","patch_set":2,"id":"008a664a_66b7c70a","line":729,"range":{"start_line":729,"start_character":24,"end_line":729,"end_character":47},"updated":"2022-08-26 07:55:52.000000000","message":"I\u0027ve checked this again. That method initially didn\u0027t raise an exception to retry it several times. It is legit that the inactive port binding register is still not in the DB during the first loops. In case we don\u0027t find it after the defined retry count (MAX_BIND_TRIES), we\u0027ll log an error.\n\nActually the fix done in the upper lines with the exception PortBindingAlreadyActive fixes exactly what you described in the bug.","commit_id":"e1cb5080ef9d95a77fdc772d72396a973b0f90eb"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"48ea261b40d6d34a8cdd4d45ba883c7f9f7c5230","unresolved":true,"context_lines":[{"line_number":726,"context_line":"                    p_utils.get_port_binding_by_status_and_host("},{"line_number":727,"context_line":"                        port_db.port_bindings, const.INACTIVE,"},{"line_number":728,"context_line":"                        host\u003dnew_binding.host,"},{"line_number":729,"context_line":"                        raise_if_not_found\u003dTrue))"},{"line_number":730,"context_line":"            cur_context \u003d driver_context.PortContext("},{"line_number":731,"context_line":"                self, plugin_context, port, network, cur_context_binding, None,"},{"line_number":732,"context_line":"                original_port\u003doport)"}],"source_content_type":"text/x-python","patch_set":2,"id":"8cd53005_e6170038","line":729,"range":{"start_line":729,"start_character":24,"end_line":729,"end_character":47},"in_reply_to":"008a664a_66b7c70a","updated":"2022-08-26 07:56:48.000000000","message":"In other words, you should keep this part as is now in base PS.","commit_id":"e1cb5080ef9d95a77fdc772d72396a973b0f90eb"},{"author":{"_account_id":31976,"name":"Bodo Petermann","email":"b.petermann@syseleven.de","username":"bpetermann"},"change_message_id":"c60c991309307abc415fb14cefd836043c50245e","unresolved":true,"context_lines":[{"line_number":726,"context_line":"                    p_utils.get_port_binding_by_status_and_host("},{"line_number":727,"context_line":"                        port_db.port_bindings, const.INACTIVE,"},{"line_number":728,"context_line":"                        host\u003dnew_binding.host,"},{"line_number":729,"context_line":"                        raise_if_not_found\u003dTrue))"},{"line_number":730,"context_line":"            cur_context \u003d driver_context.PortContext("},{"line_number":731,"context_line":"                self, plugin_context, port, network, cur_context_binding, None,"},{"line_number":732,"context_line":"                original_port\u003doport)"}],"source_content_type":"text/x-python","patch_set":2,"id":"e544c767_70a6d426","line":729,"range":{"start_line":729,"start_character":24,"end_line":729,"end_character":47},"in_reply_to":"8cd53005_e6170038","updated":"2022-08-31 14:00:16.000000000","message":"If I understand correctly, the `raise_if_not_found\u003dTrue` should be removed?\nPotentially that could lead to cur_context_binding \u003d None. In the case I try to fix we won\u0027t get here, because PortBindingAlreadyActive exception is already raised earlier. But there might be other scenarios where the inactive binding isn\u0027t found anymore. And cur_context_binding \u003d None will cause the PortContext creation to crash.\n\nShould we check for `cur_context_binding is None` and return e.g. `orig_context, False, True`?","commit_id":"e1cb5080ef9d95a77fdc772d72396a973b0f90eb"},{"author":{"_account_id":31976,"name":"Bodo Petermann","email":"b.petermann@syseleven.de","username":"bpetermann"},"change_message_id":"3ce8dc981da2d4bda74223e4675e33712c226a72","unresolved":false,"context_lines":[{"line_number":726,"context_line":"                    p_utils.get_port_binding_by_status_and_host("},{"line_number":727,"context_line":"                        port_db.port_bindings, const.INACTIVE,"},{"line_number":728,"context_line":"                        host\u003dnew_binding.host,"},{"line_number":729,"context_line":"                        raise_if_not_found\u003dTrue))"},{"line_number":730,"context_line":"            cur_context \u003d driver_context.PortContext("},{"line_number":731,"context_line":"                self, plugin_context, port, network, cur_context_binding, None,"},{"line_number":732,"context_line":"                original_port\u003doport)"}],"source_content_type":"text/x-python","patch_set":2,"id":"a2f7845d_a7a0be70","line":729,"range":{"start_line":729,"start_character":24,"end_line":729,"end_character":47},"in_reply_to":"9e48ea80_f1702252","updated":"2023-03-21 17:09:40.000000000","message":"I removed the `raise_if_not_found\u003dTrue`","commit_id":"e1cb5080ef9d95a77fdc772d72396a973b0f90eb"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"b2af01456b4525f8142ed8f408d8f34598f67622","unresolved":true,"context_lines":[{"line_number":726,"context_line":"                    p_utils.get_port_binding_by_status_and_host("},{"line_number":727,"context_line":"                        port_db.port_bindings, const.INACTIVE,"},{"line_number":728,"context_line":"                        host\u003dnew_binding.host,"},{"line_number":729,"context_line":"                        raise_if_not_found\u003dTrue))"},{"line_number":730,"context_line":"            cur_context \u003d driver_context.PortContext("},{"line_number":731,"context_line":"                self, plugin_context, port, network, cur_context_binding, None,"},{"line_number":732,"context_line":"                original_port\u003doport)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9e48ea80_f1702252","line":729,"range":{"start_line":729,"start_character":24,"end_line":729,"end_character":47},"in_reply_to":"e544c767_70a6d426","updated":"2023-03-21 16:48:59.000000000","message":"We can\u0027t reach this point, at least in the case reported. And if we add \"raise_if_not_found\u003dTrue\", as commented, we can fail unnecessarily.\n\nWe can\u0027t reach the point of \"cur_context_binding\u003dNone\" if we have discarded the option of a duplicated call in the previous lines.\n\nI\u0027ve manually tested this with your reproducer (sending two activation calls very close) and instead of the nasty exception we had before, we have the \"PortBindingAlreadyActive\" exception returned by Neutron [1] (only with the code in L678-683).\n\n[1]https://paste.opendev.org/show/beHa6RdI3QR4XgbrjhHz/","commit_id":"e1cb5080ef9d95a77fdc772d72396a973b0f90eb"}],"neutron/tests/unit/plugins/ml2/test_port_binding.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"c0848ba8a962f72c41e884969001b6b5ca3a447b","unresolved":true,"context_lines":[{"line_number":576,"context_line":"                result_2 \u003d f2.result()"},{"line_number":577,"context_line":""},{"line_number":578,"context_line":"        # one request should have been successful"},{"line_number":579,"context_line":"        self.assertTrue(result_1 or result_2)"},{"line_number":580,"context_line":"        # one request should have received a HTTPConflict response"},{"line_number":581,"context_line":"        self.assertIn(webob.exc.HTTPConflict.code,"},{"line_number":582,"context_line":"                      (result_1.status_int, result_2.status_int))"}],"source_content_type":"text/x-python","patch_set":4,"id":"06b54969_62c1787d","line":579,"updated":"2023-03-21 18:46:17.000000000","message":"Is this correct? Couldn\u0027t both be True and this would pass? If so the comment should also be \"only one\" and the check could be:\n\nself.assertFalse(result_1 and result_2)\n\nGuess something similar would apply below if only one could have had a conflict.","commit_id":"3ed9a4a28bb4e065e12fc3b19bfc59da9e6dd3aa"},{"author":{"_account_id":31976,"name":"Bodo Petermann","email":"b.petermann@syseleven.de","username":"bpetermann"},"change_message_id":"fb6e2f25a08e755c0976a5320c70bfa99aad44e7","unresolved":false,"context_lines":[{"line_number":576,"context_line":"                result_2 \u003d f2.result()"},{"line_number":577,"context_line":""},{"line_number":578,"context_line":"        # one request should have been successful"},{"line_number":579,"context_line":"        self.assertTrue(result_1 or result_2)"},{"line_number":580,"context_line":"        # one request should have received a HTTPConflict response"},{"line_number":581,"context_line":"        self.assertIn(webob.exc.HTTPConflict.code,"},{"line_number":582,"context_line":"                      (result_1.status_int, result_2.status_int))"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f5a2262_dbf05189","line":579,"in_reply_to":"06b54969_62c1787d","updated":"2023-03-22 11:18:53.000000000","message":"the boolean test was in fact wrong. The intension of the tests was to check that one request succeeds and the other receives a 409/Conflict.\nI changed the test.","commit_id":"3ed9a4a28bb4e065e12fc3b19bfc59da9e6dd3aa"}]}
