)]}'
{"neutron/objects/qos/rule.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"1437a8eba5d85d94bbba6ea35aebd236c3017983","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def get_rules(context, qos_policy_id):"},{"line_number":31,"context_line":"    all_rules \u003d []"},{"line_number":32,"context_line":"    with db_api.autonested_transaction(context.session):"},{"line_number":33,"context_line":"        for rule_type in qos_consts.VALID_RULE_TYPES:"},{"line_number":34,"context_line":"            rule_cls_name \u003d \u0027Qos%sRule\u0027 % utils.camelize(rule_type)"},{"line_number":35,"context_line":"            rule_cls \u003d getattr(sys.modules[__name__], rule_cls_name)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a50d1a3_233d90bb","line":32,"updated":"2015-07-30 13:57:17.000000000","message":"why does this need to be under a transaction?","commit_id":"def87ac2d7232676de823818b4dd2622fca10135"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2aab277426c74c09ecc08e16fd49927e20d9457e","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def get_rules(context, qos_policy_id):"},{"line_number":31,"context_line":"    all_rules \u003d []"},{"line_number":32,"context_line":"    with db_api.autonested_transaction(context.session):"},{"line_number":33,"context_line":"        for rule_type in qos_consts.VALID_RULE_TYPES:"},{"line_number":34,"context_line":"            rule_cls_name \u003d \u0027Qos%sRule\u0027 % utils.camelize(rule_type)"},{"line_number":35,"context_line":"            rule_cls \u003d getattr(sys.modules[__name__], rule_cls_name)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a50d1a3_e367a8b5","line":32,"in_reply_to":"3a50d1a3_233d90bb","updated":"2015-07-30 14:02:15.000000000","message":"We want the method to return a consistent state of rules at some particular moment in time. Without that autonested transaction manager applied, each list of rules will be fetched in an independent transaction, so there is a chance that it will return it inconsistently.\n\nFor example,\n\n- policy has rules: type1 \u003d X1, type2 \u003d Y2\n- get_rules is called, it fetches list of type1 rules. in all_rules, we have type1 \u003d X\n- client updates type1 \u003d X2\n- client updates type2 \u003d Y2\n- get_rules proceed, fetching list of type2 rules. in all rules, we have type1 \u003d X, type2 \u003d Y2.\n\nWhich is inconsistent with any particular state in the flow of interactions with the client.","commit_id":"def87ac2d7232676de823818b4dd2622fca10135"}],"neutron/tests/unit/objects/qos/test_policy.py":[{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"1937604bc8028d576a9d6f10804a43a2780b2c86","unresolved":false,"context_lines":[{"line_number":227,"context_line":"    def test_create_is_in_single_transaction(self):"},{"line_number":228,"context_line":"        obj \u003d self._test_class(self.context, **self.db_obj)"},{"line_number":229,"context_line":"        with mock.patch(\u0027sqlalchemy.engine.\u0027"},{"line_number":230,"context_line":"                        \u0027Connection._commit_impl\u0027) as mock_commit,\\"},{"line_number":231,"context_line":"                mock.patch.object(obj._context.session, \u0027add\u0027):"},{"line_number":232,"context_line":"            obj.create()"},{"line_number":233,"context_line":"        self.assertEqual(1, mock_commit.call_count)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a50d1a3_eb99e41f","line":230,"updated":"2015-07-29 22:26:45.000000000","message":"why changing from one to the other? I assume the new one is the lower level implementation?.","commit_id":"fba303fa2d55e9f49f4d7326c97bb8f5f20db8ce"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"98500c505ce96267d84bf93fef64937d2fb0e2f2","unresolved":false,"context_lines":[{"line_number":227,"context_line":"    def test_create_is_in_single_transaction(self):"},{"line_number":228,"context_line":"        obj \u003d self._test_class(self.context, **self.db_obj)"},{"line_number":229,"context_line":"        with mock.patch(\u0027sqlalchemy.engine.\u0027"},{"line_number":230,"context_line":"                        \u0027Connection._commit_impl\u0027) as mock_commit,\\"},{"line_number":231,"context_line":"                mock.patch.object(obj._context.session, \u0027add\u0027):"},{"line_number":232,"context_line":"            obj.create()"},{"line_number":233,"context_line":"        self.assertEqual(1, mock_commit.call_count)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a50d1a3_1138ec3c","line":230,"in_reply_to":"3a50d1a3_eb99e41f","updated":"2015-07-30 08:50:02.000000000","message":"The old one was triggered for any subtxn closed, even if COMMIT was not really issued. The new one is the entrypoint for COMMIT in sql driver.","commit_id":"fba303fa2d55e9f49f4d7326c97bb8f5f20db8ce"}]}
