)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"a9f5f23365d63ac5369d4b68ba7ac501f2663d8c","unresolved":false,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This problem is happening now in testing, where several QoS rules are"},{"line_number":18,"context_line":"created at the same time in the OVSDB. This should not happen in a"},{"line_number":19,"context_line":"production environment, where only one OVS agent must be running."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Closes-Bug: #1845176"},{"line_number":22,"context_line":"Change-Id: Ia9077fc20e4ca360819a2e368c8c1f9250e5a6d8"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3fa7e38b_62337af7","line":19,"updated":"2019-10-14 08:54:18.000000000","message":"If this is \"test only\" issue, is there maybe any other possible solution to fix that in fullstack tests and not change production code just because of tests?\n\nHow it can happend that some other QoS references to the same Queue?\nFor example in test which failed like that in bug report, there was only one agent spawned: https://storage.gra1.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/zuul_opendev_logs_847/681893/1/gate/neutron-fullstack/847f4d9/controller/logs/dsvm-fullstack-logs/TestMinBwQoSOvs.test_bw_limit_qos_port_removed_egress_/\n\nI know that there are other tests running and spawning ovs agents in parallel but neutron-ovs agent is looking for QoS and Queues always using port_name and port_name is based on uuid. Do You think we could have same port names for more than one port?\nMaybe we than should add \"bridge_name\" to https://github.com/openstack/neutron/blob/master/neutron/agent/common/ovs_lib.py#L715 and https://github.com/openstack/neutron/blob/master/neutron/agent/common/ovs_lib.py#L723 and to places where we are creating those queues and qos?","commit_id":"eb7060b0e9fb22f6987fde325d2974fa2da85e20"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"1a266173f2126213a93054826c101887e7cc8376","unresolved":false,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This problem is happening now in testing, where several QoS rules are"},{"line_number":18,"context_line":"created at the same time in the OVSDB. This should not happen in a"},{"line_number":19,"context_line":"production environment, where only one OVS agent must be running."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Closes-Bug: #1845176"},{"line_number":22,"context_line":"Change-Id: Ia9077fc20e4ca360819a2e368c8c1f9250e5a6d8"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3fa7e38b_77d80f52","line":19,"in_reply_to":"3fa7e38b_62337af7","updated":"2019-10-14 18:01:30.000000000","message":"Actually you are right. The problem we are seeing here is that in [1] (the tests case with the error), we are detecting a port created in [2], in particular port e94ef7d2-82e8-43cf-8978-6b9ba8e9ad3f. In [2], this port is created and a Queue is assigned (a1470780-1834-48d9-afd0-6fe41fcbb027) with min-rate 300000.\n\nWhen test [1] receives the notification of a new port (created in [2]), it tries to delete it:\n- Find the agent QoS: this is unique (should be unique), based on\n    OVSBridge._min_bw_qos_id \u003d uuidutils.generate_uuid()\n- Find the Queue, based on the port ID. In this case, this Queue is NOT in this QoS. When the QoS register is deleted, the Queue is still attached to the QoS register created in [2], with another _id \u003d _min_bw_qos_id.\n\nHere is when we have the referential integrity violation exception.\n\nThis is happening only in tests but this could be solved by adding/deleting the QoS rule information in QosOVSAgentDriver.port, the same as in:\n- delete_bandwidth_limit\n- delete_bandwidth_limit_ingress\n- delete_dscp_marking\n\n\n[1] https://storage.gra1.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/zuul_opendev_logs_847/681893/1/gate/neutron-fullstack/847f4d9/controller/logs/dsvm-fullstack-logs/TestMinBwQoSOvs.test_bw_limit_qos_port_removed_egress_/neutron-openvswitch-agent--2019-09-17--05-35-29-575569_log.txt.gz\n[2] https://storage.gra1.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/zuul_opendev_logs_847/681893/1/gate/neutron-fullstack/847f4d9/controller/logs/dsvm-fullstack-logs/TestMinBwQoSOvs.test_min_bw_qos_policy_rule_lifecycle_egress_/neutron-openvswitch-agent--2019-09-17--05-35-33-485208_log.txt.gz","commit_id":"eb7060b0e9fb22f6987fde325d2974fa2da85e20"}],"neutron/agent/common/ovs_lib.py":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"a9f5f23365d63ac5369d4b68ba7ac501f2663d8c","unresolved":false,"context_lines":[{"line_number":1076,"context_line":"                        {\u0027queue\u0027: str(queue_id),"},{"line_number":1077,"context_line":"                         \u0027qoses\u0027: \u0027, \u0027.join(sorted(qos_uuids))})"},{"line_number":1078,"context_line":"            self.ovsdb.db_destroy(\u0027Queue\u0027, queue_id).execute("},{"line_number":1079,"context_line":"                check_error\u003dTrue)"},{"line_number":1080,"context_line":""},{"line_number":1081,"context_line":"    def _update_qos(self, qos_id\u003dNone, queues\u003dNone):"},{"line_number":1082,"context_line":"        queues \u003d queues or {}"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_7fec73ba","line":1079,"updated":"2019-10-14 08:54:18.000000000","message":"If queue was still in use by other QoS rules, aren\u0027t we going to break something else which used this? Like e.g. second agent which will also try to delete it and will fail?","commit_id":"eb7060b0e9fb22f6987fde325d2974fa2da85e20"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"1a266173f2126213a93054826c101887e7cc8376","unresolved":false,"context_lines":[{"line_number":1076,"context_line":"                        {\u0027queue\u0027: str(queue_id),"},{"line_number":1077,"context_line":"                         \u0027qoses\u0027: \u0027, \u0027.join(sorted(qos_uuids))})"},{"line_number":1078,"context_line":"            self.ovsdb.db_destroy(\u0027Queue\u0027, queue_id).execute("},{"line_number":1079,"context_line":"                check_error\u003dTrue)"},{"line_number":1080,"context_line":""},{"line_number":1081,"context_line":"    def _update_qos(self, qos_id\u003dNone, queues\u003dNone):"},{"line_number":1082,"context_line":"        queues \u003d queues or {}"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_ab962d4b","line":1079,"in_reply_to":"3fa7e38b_7fec73ba","updated":"2019-10-14 18:01:30.000000000","message":"No other agent/process should use this Queue. This Queue is created specifically by the OVS agent and only to shape the traffic of those ports with the same QoS policy and rule. This should never happen in a real environment. In this case, of course something will be broken but because other process is managing something does not own.","commit_id":"eb7060b0e9fb22f6987fde325d2974fa2da85e20"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"11f8b6f77438c7e244a58a8955642768cecf624e","unresolved":false,"context_lines":[{"line_number":1065,"context_line":"                qos_regs \u003d self._list_qos()"},{"line_number":1066,"context_line":"                qos_uuids \u003d []"},{"line_number":1067,"context_line":"                for qos_reg in qos_regs:"},{"line_number":1068,"context_line":"                    queue_nums \u003d [num for num, q in qos_reg[\u0027queues\u0027].items()"},{"line_number":1069,"context_line":"                                  if q.uuid \u003d\u003d queue_id]"},{"line_number":1070,"context_line":"                    if queue_nums:"},{"line_number":1071,"context_line":"                        qos_uuids.append(str(qos_reg[\u0027_uuid\u0027]))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_1acc5033","line":1068,"range":{"start_line":1068,"start_character":34,"end_line":1068,"end_character":77},"updated":"2019-10-15 17:52:11.000000000","message":"I believe this is equivalent to just doing:\n\n    num for num in qos_reg[\u0027queues\u0027]\n\nsince \u0027in\u0027 just does the keys of a dict.","commit_id":"af54d133a98a7f1c98a0805fb409fd48f434a98b"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"fca2fd0ec34025b14411d1fa2a391266cbf9b1f7","unresolved":false,"context_lines":[{"line_number":1065,"context_line":"                qos_regs \u003d self._list_qos()"},{"line_number":1066,"context_line":"                qos_uuids \u003d []"},{"line_number":1067,"context_line":"                for qos_reg in qos_regs:"},{"line_number":1068,"context_line":"                    queue_nums \u003d [num for num, q in qos_reg[\u0027queues\u0027].items()"},{"line_number":1069,"context_line":"                                  if q.uuid \u003d\u003d queue_id]"},{"line_number":1070,"context_line":"                    if queue_nums:"},{"line_number":1071,"context_line":"                        qos_uuids.append(str(qos_reg[\u0027_uuid\u0027]))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_e78e7577","line":1068,"range":{"start_line":1068,"start_character":34,"end_line":1068,"end_character":77},"in_reply_to":"3fa7e38b_1acc5033","updated":"2019-10-16 06:52:51.000000000","message":"But I need the value to compare in L1069. This is filtering the queues with queue.uuid \u003d\u003d to the related queue_id we tried to delete.","commit_id":"af54d133a98a7f1c98a0805fb409fd48f434a98b"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"4609ac529fb47f04df45a1b945e117c7f571a054","unresolved":false,"context_lines":[{"line_number":1065,"context_line":"                qos_regs \u003d self._list_qos()"},{"line_number":1066,"context_line":"                qos_uuids \u003d []"},{"line_number":1067,"context_line":"                for qos_reg in qos_regs:"},{"line_number":1068,"context_line":"                    queue_nums \u003d [num for num, q in qos_reg[\u0027queues\u0027].items()"},{"line_number":1069,"context_line":"                                  if q.uuid \u003d\u003d queue_id]"},{"line_number":1070,"context_line":"                    if queue_nums:"},{"line_number":1071,"context_line":"                        qos_uuids.append(str(qos_reg[\u0027_uuid\u0027]))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_679d8cba","line":1068,"range":{"start_line":1068,"start_character":34,"end_line":1068,"end_character":77},"in_reply_to":"3fa7e38b_e78e7577","updated":"2019-10-17 13:51:27.000000000","message":"I\u0027m blind. :p","commit_id":"af54d133a98a7f1c98a0805fb409fd48f434a98b"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"65ba7ad1cc07bc5adc318379f3d4df0889cc7506","unresolved":false,"context_lines":[{"line_number":1089,"context_line":"        except RuntimeError as exc:"},{"line_number":1090,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":1091,"context_line":"                if \u0027referential integrity violation\u0027 not in str(exc):"},{"line_number":1092,"context_line":"                    return"},{"line_number":1093,"context_line":"                qos_regs \u003d self._list_qos()"},{"line_number":1094,"context_line":"                qos_uuids \u003d []"},{"line_number":1095,"context_line":"                for qos_reg in qos_regs:"}],"source_content_type":"text/x-python","patch_set":14,"id":"3fa7e38b_bb2c4201","line":1092,"updated":"2020-01-07 12:58:01.000000000","message":"so You will silently ignore all other RuntimeErrors here? Is that ok?","commit_id":"768c52c73ce28e9ca1d4df62c448d56dadabcef8"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"1da6a0c1458ae4c13280577cad7052a78ab13288","unresolved":false,"context_lines":[{"line_number":1089,"context_line":"        except RuntimeError as exc:"},{"line_number":1090,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":1091,"context_line":"                if \u0027referential integrity violation\u0027 not in str(exc):"},{"line_number":1092,"context_line":"                    return"},{"line_number":1093,"context_line":"                qos_regs \u003d self._list_qos()"},{"line_number":1094,"context_line":"                qos_uuids \u003d []"},{"line_number":1095,"context_line":"                for qos_reg in qos_regs:"}],"source_content_type":"text/x-python","patch_set":14,"id":"3fa7e38b_bcdf5936","line":1092,"in_reply_to":"3fa7e38b_bb2c4201","updated":"2020-01-07 14:39:35.000000000","message":"No, this will exit the \"excutils.save_and_reraise_exception()\" context and this will re-raise the previous exception. I\u0027m not ignoring any RuntimeError, just avoiding those ones not related to referential errors.","commit_id":"768c52c73ce28e9ca1d4df62c448d56dadabcef8"}],"neutron/tests/functional/agent/common/test_ovs_lib.py":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"65ba7ad1cc07bc5adc318379f3d4df0889cc7506","unresolved":false,"context_lines":[{"line_number":231,"context_line":"        qos_id_1 \u003d self._create_qos(queues\u003dqueues)"},{"line_number":232,"context_line":"        self.ovs._min_bw_qos_id \u003d uuidutils.generate_uuid()"},{"line_number":233,"context_line":"        qos_id_2 \u003d self._create_qos(queues\u003dqueues)"},{"line_number":234,"context_line":"        with mock.patch.object(ovs_lib.LOG, \u0027error\u0027) as mock_warning:"},{"line_number":235,"context_line":"            self.assertRaises(RuntimeError, self.ovs._delete_queue,"},{"line_number":236,"context_line":"                              queue_id)"},{"line_number":237,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3fa7e38b_fb3dda28","line":234,"range":{"start_line":234,"start_character":56,"end_line":234,"end_character":68},"updated":"2020-01-07 12:58:01.000000000","message":"why \"mock_warning\" as You are mocking \"error\" method in fact?","commit_id":"768c52c73ce28e9ca1d4df62c448d56dadabcef8"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"1da6a0c1458ae4c13280577cad7052a78ab13288","unresolved":false,"context_lines":[{"line_number":231,"context_line":"        qos_id_1 \u003d self._create_qos(queues\u003dqueues)"},{"line_number":232,"context_line":"        self.ovs._min_bw_qos_id \u003d uuidutils.generate_uuid()"},{"line_number":233,"context_line":"        qos_id_2 \u003d self._create_qos(queues\u003dqueues)"},{"line_number":234,"context_line":"        with mock.patch.object(ovs_lib.LOG, \u0027error\u0027) as mock_warning:"},{"line_number":235,"context_line":"            self.assertRaises(RuntimeError, self.ovs._delete_queue,"},{"line_number":236,"context_line":"                              queue_id)"},{"line_number":237,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3fa7e38b_3cbda9d6","line":234,"range":{"start_line":234,"start_character":56,"end_line":234,"end_character":68},"in_reply_to":"3fa7e38b_fb3dda28","updated":"2020-01-07 14:39:35.000000000","message":"Upssss, maybe that\u0027s some copy/paste, I don\u0027t remember","commit_id":"768c52c73ce28e9ca1d4df62c448d56dadabcef8"}]}
