)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"8bb6b3644044cb3637fbac3f91f008cc50c26dc2","unresolved":false,"context_lines":[{"line_number":18,"context_line":"With new enginefacade we change context.session.begin() for"},{"line_number":19,"context_line":"db.context_manager.writer(reader).using(context)."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"When object leaves this with-block, it\u0027s reference to session is"},{"line_number":22,"context_line":"cleared because session is discarded. To use this object later to"},{"line_number":23,"context_line":"load some data from its dependencies, we have to provide different"},{"line_number":24,"context_line":"session to work in. To solve this obj either can be moved under"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":39,"id":"fa31d9ce_454d003d","line":21,"range":{"start_line":21,"start_character":36,"end_line":21,"end_character":40},"updated":"2017-02-14 14:34:11.000000000","message":"its","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"bc5ed5e37706ea62a3a58223628311d6becb3d78","unresolved":false,"context_lines":[{"line_number":18,"context_line":"With new enginefacade we change context.session.begin() for"},{"line_number":19,"context_line":"db.context_manager.writer(reader).using(context)."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"When object leaves this with-block, it\u0027s reference to session is"},{"line_number":22,"context_line":"cleared because session is discarded. To use this object later to"},{"line_number":23,"context_line":"load some data from its dependencies, we have to provide different"},{"line_number":24,"context_line":"session to work in. To solve this obj either can be moved under"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":39,"id":"fa31d9ce_89f1b26d","line":21,"range":{"start_line":21,"start_character":36,"end_line":21,"end_character":40},"in_reply_to":"fa31d9ce_454d003d","updated":"2017-02-15 07:22:48.000000000","message":"Done","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"8bb6b3644044cb3637fbac3f91f008cc50c26dc2","unresolved":false,"context_lines":[{"line_number":25,"context_line":"with-block or we have to do context.session.add(obj) one more time"},{"line_number":26,"context_line":"to be able to load relations."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"This change also switch to usage of new enginefacade for some db"},{"line_number":29,"context_line":"operations with ports, in order to pass unit and funtional tests."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"Partially-Implements blueprint: enginefacade-switch"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":39,"id":"fa31d9ce_050dc8e7","line":28,"range":{"start_line":28,"start_character":17,"end_line":28,"end_character":23},"updated":"2017-02-14 14:34:11.000000000","message":"switches","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"bc5ed5e37706ea62a3a58223628311d6becb3d78","unresolved":false,"context_lines":[{"line_number":25,"context_line":"with-block or we have to do context.session.add(obj) one more time"},{"line_number":26,"context_line":"to be able to load relations."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"This change also switch to usage of new enginefacade for some db"},{"line_number":29,"context_line":"operations with ports, in order to pass unit and funtional tests."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"Partially-Implements blueprint: enginefacade-switch"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":39,"id":"fa31d9ce_c9e72aaa","line":28,"range":{"start_line":28,"start_character":17,"end_line":28,"end_character":23},"in_reply_to":"fa31d9ce_050dc8e7","updated":"2017-02-15 07:22:48.000000000","message":"Done","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"8bb6b3644044cb3637fbac3f91f008cc50c26dc2","unresolved":false,"context_lines":[{"line_number":26,"context_line":"to be able to load relations."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"This change also switch to usage of new enginefacade for some db"},{"line_number":29,"context_line":"operations with ports, in order to pass unit and funtional tests."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"Partially-Implements blueprint: enginefacade-switch"},{"line_number":32,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":39,"id":"fa31d9ce_2512cc09","line":29,"range":{"start_line":29,"start_character":49,"end_line":29,"end_character":58},"updated":"2017-02-14 14:34:11.000000000","message":"functional","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"bc5ed5e37706ea62a3a58223628311d6becb3d78","unresolved":false,"context_lines":[{"line_number":26,"context_line":"to be able to load relations."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"This change also switch to usage of new enginefacade for some db"},{"line_number":29,"context_line":"operations with ports, in order to pass unit and funtional tests."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"Partially-Implements blueprint: enginefacade-switch"},{"line_number":32,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":39,"id":"fa31d9ce_0906a251","line":29,"range":{"start_line":29,"start_character":49,"end_line":29,"end_character":58},"in_reply_to":"fa31d9ce_2512cc09","updated":"2017-02-15 07:22:48.000000000","message":"Done","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"}],"neutron/db/db_base_plugin_v2.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"232bac16baa03f148fd3c2e80810336f3c78ff35","unresolved":false,"context_lines":[{"line_number":321,"context_line":"        collection \u003d \"%ss\" % resource"},{"line_number":322,"context_line":"        items \u003d request_items[collection]"},{"line_number":323,"context_line":"        try:"},{"line_number":324,"context_line":"            with db_api.context_manager.writer.using(context):"},{"line_number":325,"context_line":"                for item in items:"},{"line_number":326,"context_line":"                    obj_creator \u003d getattr(self, \u0027create_%s\u0027 % resource)"},{"line_number":327,"context_line":"                    objects.append(obj_creator(context, item))"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a6eadb0_d82b1b2f","line":324,"updated":"2016-12-13 14:08:55.000000000","message":"nice","commit_id":"02a304984162b31437b18f8daab525fe2d6ddb22"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"df9f95a961ae993d1aa70dc1dbbb08768ee55bed","unresolved":false,"context_lines":[{"line_number":820,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":821,"context_line":"            subnet, changes \u003d self.ipam.update_db_subnet(context, id, s,"},{"line_number":822,"context_line":"                                                         db_pools)"},{"line_number":823,"context_line":"        # we expire here since ipam may have made changes to relationships"},{"line_number":824,"context_line":"        # that will be stale on any subsequent lookups while the subnet object"},{"line_number":825,"context_line":"        # is in the session otherwise."},{"line_number":826,"context_line":"        context.session.expire(subnet)"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_664d993d","side":"PARENT","line":823,"updated":"2017-01-17 18:54:26.000000000","message":"don\u0027t we want to keep the comment in place? it seems to give additional details about rationale for the workaround.","commit_id":"0273435cea6e7b32355512f82124f9d3e1a4b4fb"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"df9f95a961ae993d1aa70dc1dbbb08768ee55bed","unresolved":false,"context_lines":[{"line_number":342,"context_line":"    def create_network(self, context, network):"},{"line_number":343,"context_line":"        \"\"\"Handle creation of a single network.\"\"\""},{"line_number":344,"context_line":"        net_db \u003d self.create_network_db(context, network)"},{"line_number":345,"context_line":"        context.session.add(net_db)"},{"line_number":346,"context_line":"        return self._make_network_dict(net_db, process_extensions\u003dFalse,"},{"line_number":347,"context_line":"                                       context\u003dcontext)"},{"line_number":348,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_067bf58c","line":345,"updated":"2017-01-17 18:54:26.000000000","message":"don\u0027t we do it already in line 368?","commit_id":"41ead5386819d890e06736defb34abc8197b468d"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"8708dc714acacad17b80f5cb2e3009ed5fb29f43","unresolved":false,"context_lines":[{"line_number":342,"context_line":"    def create_network(self, context, network):"},{"line_number":343,"context_line":"        \"\"\"Handle creation of a single network.\"\"\""},{"line_number":344,"context_line":"        net_db \u003d self.create_network_db(context, network)"},{"line_number":345,"context_line":"        context.session.add(net_db)"},{"line_number":346,"context_line":"        return self._make_network_dict(net_db, process_extensions\u003dFalse,"},{"line_number":347,"context_line":"                                       context\u003dcontext)"},{"line_number":348,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_39d63d4f","line":345,"in_reply_to":"7a3c09a3_067bf58c","updated":"2017-01-18 07:38:16.000000000","message":"When \u0027network\u0027 object leaves this with-block, it\u0027s reference to session is cleared because session is discarded. To use this object later to load some data from its dependencies, we have to provide different session to work in.","commit_id":"41ead5386819d890e06736defb34abc8197b468d"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"df9f95a961ae993d1aa70dc1dbbb08768ee55bed","unresolved":false,"context_lines":[{"line_number":397,"context_line":"            # stored in other database tables handled by extensions"},{"line_number":398,"context_line":"            network.update("},{"line_number":399,"context_line":"                ndb_utils.filter_non_model_columns(n, models_v2.Network))"},{"line_number":400,"context_line":"            return self._make_network_dict(network, context\u003dcontext)"},{"line_number":401,"context_line":""},{"line_number":402,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":403,"context_line":"    def delete_network(self, context, id):"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_a68ea176","line":400,"updated":"2017-01-17 18:54:26.000000000","message":"what\u0027s the reason for the change here?","commit_id":"41ead5386819d890e06736defb34abc8197b468d"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"8708dc714acacad17b80f5cb2e3009ed5fb29f43","unresolved":false,"context_lines":[{"line_number":397,"context_line":"            # stored in other database tables handled by extensions"},{"line_number":398,"context_line":"            network.update("},{"line_number":399,"context_line":"                ndb_utils.filter_non_model_columns(n, models_v2.Network))"},{"line_number":400,"context_line":"            return self._make_network_dict(network, context\u003dcontext)"},{"line_number":401,"context_line":""},{"line_number":402,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":403,"context_line":"    def delete_network(self, context, id):"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_b9c22d83","line":400,"in_reply_to":"7a3c09a3_a68ea176","updated":"2017-01-18 07:38:16.000000000","message":"To load relationship for network without errors.","commit_id":"41ead5386819d890e06736defb34abc8197b468d"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"df9f95a961ae993d1aa70dc1dbbb08768ee55bed","unresolved":false,"context_lines":[{"line_number":740,"context_line":"                                                            network,"},{"line_number":741,"context_line":"                                                            subnet[\u0027subnet\u0027],"},{"line_number":742,"context_line":"                                                            subnetpool_id)"},{"line_number":743,"context_line":"            result \u003d self._make_subnet_dict(subnet, context\u003dcontext)"},{"line_number":744,"context_line":"        return result, network, ipam_subnet"},{"line_number":745,"context_line":""},{"line_number":746,"context_line":"    def _update_allocation_pools(self, subnet):"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_46cdfdb5","line":743,"updated":"2017-01-17 18:54:26.000000000","message":"same question","commit_id":"41ead5386819d890e06736defb34abc8197b468d"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"df9f95a961ae993d1aa70dc1dbbb08768ee55bed","unresolved":false,"context_lines":[{"line_number":823,"context_line":"        # Temporary workarond"},{"line_number":824,"context_line":"        try:"},{"line_number":825,"context_line":"            context.session.expire(subnet)"},{"line_number":826,"context_line":"        except sa_exc.InvalidRequestError:"},{"line_number":827,"context_line":"            pass"},{"line_number":828,"context_line":""},{"line_number":829,"context_line":"        return self._make_subnet_dict(subnet, context\u003dcontext)"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_06da154c","line":826,"updated":"2017-01-17 18:54:26.000000000","message":"what\u0027s that handler for, and why wasn\u0027t it needed before? I don\u0027t see SQLAlchemy docs documenting the exception type for the .expire call.","commit_id":"41ead5386819d890e06736defb34abc8197b468d"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"8708dc714acacad17b80f5cb2e3009ed5fb29f43","unresolved":false,"context_lines":[{"line_number":823,"context_line":"        # Temporary workarond"},{"line_number":824,"context_line":"        try:"},{"line_number":825,"context_line":"            context.session.expire(subnet)"},{"line_number":826,"context_line":"        except sa_exc.InvalidRequestError:"},{"line_number":827,"context_line":"            pass"},{"line_number":828,"context_line":""},{"line_number":829,"context_line":"        return self._make_subnet_dict(subnet, context\u003dcontext)"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_d99e1962","line":826,"in_reply_to":"7a3c09a3_06da154c","updated":"2017-01-18 07:38:16.000000000","message":"InvalidRequestError raised here when we try to expire object that is not in this session already http://docs.sqlalchemy.org/en/latest/core/exceptions.html#sqlalchemy.exc.InvalidRequestError","commit_id":"41ead5386819d890e06736defb34abc8197b468d"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"b8c7b569e42f4315f4ee9cab4a270ee2ab055d94","unresolved":false,"context_lines":[{"line_number":823,"context_line":"        # Temporary workarond"},{"line_number":824,"context_line":"        try:"},{"line_number":825,"context_line":"            context.session.expire(subnet)"},{"line_number":826,"context_line":"        except sa_exc.InvalidRequestError:"},{"line_number":827,"context_line":"            pass"},{"line_number":828,"context_line":""},{"line_number":829,"context_line":"        return self._make_subnet_dict(subnet, context\u003dcontext)"}],"source_content_type":"text/x-python","patch_set":27,"id":"5a3905b3_4020334a","line":826,"in_reply_to":"7a3c09a3_51610404","updated":"2017-01-19 08:51:09.000000000","message":"This was added by https://github.com/openstack/neutron/commit/cd7d63bde92e47a4b7bd4212b2e6c45f08c03143 - so in order to bump revision number of subnet in case extension was updated.","commit_id":"41ead5386819d890e06736defb34abc8197b468d"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"50e02d1c1a030a0efbb9dc1ac8c71f8536eeadac","unresolved":false,"context_lines":[{"line_number":823,"context_line":"        # Temporary workarond"},{"line_number":824,"context_line":"        try:"},{"line_number":825,"context_line":"            context.session.expire(subnet)"},{"line_number":826,"context_line":"        except sa_exc.InvalidRequestError:"},{"line_number":827,"context_line":"            pass"},{"line_number":828,"context_line":""},{"line_number":829,"context_line":"        return self._make_subnet_dict(subnet, context\u003dcontext)"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_51610404","line":826,"in_reply_to":"7a3c09a3_d99e1962","updated":"2017-01-18 15:37:32.000000000","message":"Why are we expiring here? Is subnet going to be refetch from DB somewhere in make_subnet_dict? I\u0027m asking because of Subnet OVO adoption and expected base DB behavior that should be mimic in OVO logic.","commit_id":"41ead5386819d890e06736defb34abc8197b468d"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"1c1f36af0f670fd8876fd355112aa3eb83923039","unresolved":false,"context_lines":[{"line_number":340,"context_line":"    def create_network(self, context, network):"},{"line_number":341,"context_line":"        \"\"\"Handle creation of a single network.\"\"\""},{"line_number":342,"context_line":"        net_db \u003d self.create_network_db(context, network)"},{"line_number":343,"context_line":"        context.session.add(net_db)"},{"line_number":344,"context_line":"        return self._make_network_dict(net_db, process_extensions\u003dFalse,"},{"line_number":345,"context_line":"                                       context\u003dcontext)"},{"line_number":346,"context_line":""}],"source_content_type":"text/x-python","patch_set":39,"id":"fa31d9ce_8518d81f","line":343,"updated":"2017-02-14 14:18:03.000000000","message":"Do we need this here? L.366 does this.\n\nIn addition, DB operation should be inside of create_network_db.\nDoing this here looks odd to me.","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"bc5ed5e37706ea62a3a58223628311d6becb3d78","unresolved":false,"context_lines":[{"line_number":340,"context_line":"    def create_network(self, context, network):"},{"line_number":341,"context_line":"        \"\"\"Handle creation of a single network.\"\"\""},{"line_number":342,"context_line":"        net_db \u003d self.create_network_db(context, network)"},{"line_number":343,"context_line":"        context.session.add(net_db)"},{"line_number":344,"context_line":"        return self._make_network_dict(net_db, process_extensions\u003dFalse,"},{"line_number":345,"context_line":"                                       context\u003dcontext)"},{"line_number":346,"context_line":""}],"source_content_type":"text/x-python","patch_set":39,"id":"fa31d9ce_49e5faa5","line":343,"in_reply_to":"fa31d9ce_6b949542","updated":"2017-02-15 07:22:48.000000000","message":"Done","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ca10147457d0e6319120b70d993430a3e94a4764","unresolved":false,"context_lines":[{"line_number":340,"context_line":"    def create_network(self, context, network):"},{"line_number":341,"context_line":"        \"\"\"Handle creation of a single network.\"\"\""},{"line_number":342,"context_line":"        net_db \u003d self.create_network_db(context, network)"},{"line_number":343,"context_line":"        context.session.add(net_db)"},{"line_number":344,"context_line":"        return self._make_network_dict(net_db, process_extensions\u003dFalse,"},{"line_number":345,"context_line":"                                       context\u003dcontext)"},{"line_number":346,"context_line":""}],"source_content_type":"text/x-python","patch_set":39,"id":"fa31d9ce_ab676db5","line":343,"in_reply_to":"fa31d9ce_8518d81f","updated":"2017-02-14 14:52:42.000000000","message":"This probably does need a comment. This is unfortunately required right now otherwise _make_network_dict will get a detached instance error if it references any relationships since it\u0027s no longer part of a session.","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e815cea2412c582142dcb69d749dba256421c6a7","unresolved":false,"context_lines":[{"line_number":340,"context_line":"    def create_network(self, context, network):"},{"line_number":341,"context_line":"        \"\"\"Handle creation of a single network.\"\"\""},{"line_number":342,"context_line":"        net_db \u003d self.create_network_db(context, network)"},{"line_number":343,"context_line":"        context.session.add(net_db)"},{"line_number":344,"context_line":"        return self._make_network_dict(net_db, process_extensions\u003dFalse,"},{"line_number":345,"context_line":"                                       context\u003dcontext)"},{"line_number":346,"context_line":""}],"source_content_type":"text/x-python","patch_set":39,"id":"fa31d9ce_6b949542","line":343,"in_reply_to":"fa31d9ce_ab676db5","updated":"2017-02-14 14:55:34.000000000","message":"Yeah, I wondered before too. Though I think the commit message explains it now, having some anchor in code to suggest it\u0027s not a mistake would be great.","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"7a2fdf1acc4e6d3e92072f4832ac0bb15f039232","unresolved":false,"context_lines":[{"line_number":395,"context_line":"            # stored in other database tables handled by extensions"},{"line_number":396,"context_line":"            network.update("},{"line_number":397,"context_line":"                ndb_utils.filter_non_model_columns(n, models_v2.Network))"},{"line_number":398,"context_line":"            return self._make_network_dict(network, context\u003dcontext)"},{"line_number":399,"context_line":""},{"line_number":400,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":401,"context_line":"    def delete_network(self, context, id):"}],"source_content_type":"text/x-python","patch_set":39,"id":"fa31d9ce_5675b5f7","line":398,"updated":"2017-02-14 16:10:53.000000000","message":"I was talking with zzzeek in the IRC channel and we shouldn\u0027t need to do this. He said that we should always be able to reference any loaded relationships even after it exits.\n\nDo you have an example of how this fails if we don\u0027t?","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"bc5ed5e37706ea62a3a58223628311d6becb3d78","unresolved":false,"context_lines":[{"line_number":395,"context_line":"            # stored in other database tables handled by extensions"},{"line_number":396,"context_line":"            network.update("},{"line_number":397,"context_line":"                ndb_utils.filter_non_model_columns(n, models_v2.Network))"},{"line_number":398,"context_line":"            return self._make_network_dict(network, context\u003dcontext)"},{"line_number":399,"context_line":""},{"line_number":400,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":401,"context_line":"    def delete_network(self, context, id):"}],"source_content_type":"text/x-python","patch_set":39,"id":"fa31d9ce_69155ee3","line":398,"in_reply_to":"fa31d9ce_5675b5f7","updated":"2017-02-15 07:22:48.000000000","message":"It fails with http://paste.openstack.org/show/598943/\nI\u0027m a bit confused as I discussed this with zzzeek errors like this. I\u0027ll add him for review here.","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"81cf49e4bb6a2b4c96a7963d889f2c11c366a7db","unresolved":false,"context_lines":[{"line_number":395,"context_line":"            # stored in other database tables handled by extensions"},{"line_number":396,"context_line":"            network.update("},{"line_number":397,"context_line":"                ndb_utils.filter_non_model_columns(n, models_v2.Network))"},{"line_number":398,"context_line":"            return self._make_network_dict(network, context\u003dcontext)"},{"line_number":399,"context_line":""},{"line_number":400,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":401,"context_line":"    def delete_network(self, context, id):"}],"source_content_type":"text/x-python","patch_set":39,"id":"fa31d9ce_7ac0b050","line":398,"in_reply_to":"fa31d9ce_69155ee3","updated":"2017-02-15 13:41:17.000000000","message":"I think this error in particular is because of the expiration on L392. If we change that to .refresh it may fix it for this case.\n\nWe may still have problems with lazy loaded relationships for newly created objects though. \n\n@Mike, won\u0027t we get these errors for our create methods that make objects that have a relationship? Because in those cases, we won\u0027t be fetching the object first in the session, which means the relationships won\u0027t be loaded for us after the session transaction is closed.","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"933b9f49e5b81765edea937fc67b2457cabdf109","unresolved":false,"context_lines":[{"line_number":395,"context_line":"            # stored in other database tables handled by extensions"},{"line_number":396,"context_line":"            network.update("},{"line_number":397,"context_line":"                ndb_utils.filter_non_model_columns(n, models_v2.Network))"},{"line_number":398,"context_line":"            return self._make_network_dict(network, context\u003dcontext)"},{"line_number":399,"context_line":""},{"line_number":400,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":401,"context_line":"    def delete_network(self, context, id):"}],"source_content_type":"text/x-python","patch_set":39,"id":"fa31d9ce_eb3db02b","line":398,"in_reply_to":"fa31d9ce_7ac0b050","updated":"2017-02-15 14:42:04.000000000","message":"The line 741 we have situation and actually we have already several patches where we have to move _make_dict under transaction if loads some relationships and we discussed this on review here https://review.openstack.org/#/c/391308/4/neutron/db/flavors_db.py@124\n\neverywhere there was DetachedInstanceError","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"e5f368c012674f133efe622fea21f050f16025c6","unresolved":false,"context_lines":[{"line_number":395,"context_line":"            # stored in other database tables handled by extensions"},{"line_number":396,"context_line":"            network.update("},{"line_number":397,"context_line":"                ndb_utils.filter_non_model_columns(n, models_v2.Network))"},{"line_number":398,"context_line":"            return self._make_network_dict(network, context\u003dcontext)"},{"line_number":399,"context_line":""},{"line_number":400,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":401,"context_line":"    def delete_network(self, context, id):"}],"source_content_type":"text/x-python","patch_set":39,"id":"fa31d9ce_2d051510","line":398,"in_reply_to":"fa31d9ce_7ac0b050","updated":"2017-02-15 17:33:38.000000000","message":"so if you make a new object and flush it, if you have a relationship that you never touched, it doesn\u0027t know anything about it and indeed will lazy load it.  However, if you set a relationship to a blank collection, then it has that blank collection as the \"official\" value.\n\nthere\u0027s ways to automate this using event handlers.  At the same time it still feels a bit like enginefacade could keep a \"read only\" Session going after the context is done here - but that implies new database transaction, which would be dangling outside the context.  again I need to know how was this working before?  Did you let context.session just hang after the method was over and get garbage collected or was there a session.close() somewhere?  otherwise how did you deal with connections hanging open under load where GC is not as efficient?","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"8bb6b3644044cb3637fbac3f91f008cc50c26dc2","unresolved":false,"context_lines":[{"line_number":822,"context_line":"        # we expire here since ipam may have made changes to relationships"},{"line_number":823,"context_line":"        # that will be stale on any subsequent lookups while the subnet"},{"line_number":824,"context_line":"        # object is in the session otherwise."},{"line_number":825,"context_line":"        # Check if subnet attached for session before expire."},{"line_number":826,"context_line":"        if subnet in context.session:"},{"line_number":827,"context_line":"            context.session.expire(subnet)"},{"line_number":828,"context_line":""}],"source_content_type":"text/x-python","patch_set":39,"id":"fa31d9ce_259c8c5c","line":825,"range":{"start_line":825,"start_character":35,"end_line":825,"end_character":38},"updated":"2017-02-14 14:34:11.000000000","message":"to","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"bc5ed5e37706ea62a3a58223628311d6becb3d78","unresolved":false,"context_lines":[{"line_number":822,"context_line":"        # we expire here since ipam may have made changes to relationships"},{"line_number":823,"context_line":"        # that will be stale on any subsequent lookups while the subnet"},{"line_number":824,"context_line":"        # object is in the session otherwise."},{"line_number":825,"context_line":"        # Check if subnet attached for session before expire."},{"line_number":826,"context_line":"        if subnet in context.session:"},{"line_number":827,"context_line":"            context.session.expire(subnet)"},{"line_number":828,"context_line":""}],"source_content_type":"text/x-python","patch_set":39,"id":"fa31d9ce_691b9eca","line":825,"range":{"start_line":825,"start_character":35,"end_line":825,"end_character":38},"in_reply_to":"fa31d9ce_259c8c5c","updated":"2017-02-15 07:22:48.000000000","message":"Done","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"a3db0eab57c50d3cf55e3f97219a37686eae830c","unresolved":false,"context_lines":[{"line_number":400,"context_line":"            # stored in other database tables handled by extensions"},{"line_number":401,"context_line":"            network.update("},{"line_number":402,"context_line":"                ndb_utils.filter_non_model_columns(n, models_v2.Network))"},{"line_number":403,"context_line":"            # TODO(ataraday): we have to move _make_network_dict under"},{"line_number":404,"context_line":"            # with-block to load relationships successfully. Revisit this"},{"line_number":405,"context_line":"            # when https://review.openstack.org/434454/ got merged"},{"line_number":406,"context_line":"            return self._make_network_dict(network, context\u003dcontext)"},{"line_number":407,"context_line":""},{"line_number":408,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":409,"context_line":"    def delete_network(self, context, id):"}],"source_content_type":"text/x-python","patch_set":44,"id":"da36d5c6_2e62cb3e","line":406,"range":{"start_line":403,"start_character":0,"end_line":406,"end_character":68},"updated":"2017-02-22 20:39:46.000000000","message":"I think moving this into the with-block makes sense - it ensures consistency among all attribute values returned, and that no changes could have occurred after the update was committed.","commit_id":"2c09897c2986cc21c2d230c4a1173c6b342d23e7"}],"neutron/db/segments_db.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"df9f95a961ae993d1aa70dc1dbbb08768ee55bed","unresolved":false,"context_lines":[{"line_number":74,"context_line":"    if not network_ids:"},{"line_number":75,"context_line":"        return {}"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    with db_api.context_manager.writer.using(context):"},{"line_number":78,"context_line":"        query \u003d (context.session.query(segments_model.NetworkSegment)."},{"line_number":79,"context_line":"                 filter(segments_model.NetworkSegment.network_id"},{"line_number":80,"context_line":"                        .in_(network_ids))."}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_e690a945","line":77,"updated":"2017-01-17 18:54:26.000000000","message":"why is it writer? it seems to solely read from db.","commit_id":"41ead5386819d890e06736defb34abc8197b468d"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"5ef00cf47a87912bc2c6fe6b2c419fbee9956e22","unresolved":false,"context_lines":[{"line_number":74,"context_line":"    if not network_ids:"},{"line_number":75,"context_line":"        return {}"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    with db_api.context_manager.writer.using(context):"},{"line_number":78,"context_line":"        query \u003d (context.session.query(segments_model.NetworkSegment)."},{"line_number":79,"context_line":"                 filter(segments_model.NetworkSegment.network_id"},{"line_number":80,"context_line":"                        .in_(network_ids))."}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_50f4b359","line":77,"in_reply_to":"7a3c09a3_e690a945","updated":"2017-01-18 12:14:42.000000000","message":"Done","commit_id":"41ead5386819d890e06736defb34abc8197b468d"}],"neutron/ipam/drivers/neutrondb_ipam/driver.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"df9f95a961ae993d1aa70dc1dbbb08768ee55bed","unresolved":false,"context_lines":[{"line_number":203,"context_line":"        # More states will be available in the future - e.g.: RECYCLABLE"},{"line_number":204,"context_line":"        try:"},{"line_number":205,"context_line":"            with db_api.context_manager.writer.using(self._context):"},{"line_number":206,"context_line":"                # NOTE(kevinbenton): we use a subtransaction to force"},{"line_number":207,"context_line":"                # a flush here so we can capture DBReferenceErrors due"},{"line_number":208,"context_line":"                # to concurrent subnet deletions. (galera would deadlock"},{"line_number":209,"context_line":"                # later on final commit)"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_06bdb5b6","line":206,"updated":"2017-01-17 18:54:26.000000000","message":"does the context manager always open a subtransaction? it seems the comment requires that.","commit_id":"41ead5386819d890e06736defb34abc8197b468d"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"5ef00cf47a87912bc2c6fe6b2c419fbee9956e22","unresolved":false,"context_lines":[{"line_number":203,"context_line":"        # More states will be available in the future - e.g.: RECYCLABLE"},{"line_number":204,"context_line":"        try:"},{"line_number":205,"context_line":"            with db_api.context_manager.writer.using(self._context):"},{"line_number":206,"context_line":"                # NOTE(kevinbenton): we use a subtransaction to force"},{"line_number":207,"context_line":"                # a flush here so we can capture DBReferenceErrors due"},{"line_number":208,"context_line":"                # to concurrent subnet deletions. (galera would deadlock"},{"line_number":209,"context_line":"                # later on final commit)"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_9dd9d3f5","line":206,"in_reply_to":"7a3c09a3_06bdb5b6","updated":"2017-01-18 12:14:42.000000000","message":"Nope, not always...","commit_id":"41ead5386819d890e06736defb34abc8197b468d"}],"neutron/ipam/subnet_alloc.py":[{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"122152a39186f9fc598bfd96e0e4ec8eeb7a4242","unresolved":false,"context_lines":[{"line_number":74,"context_line":"                                      subnet_pool_id\u003dself._subnetpool[\u0027id\u0027]))"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def _get_allocated_cidrs(self):"},{"line_number":77,"context_line":"        with db_api.context_manager.reader.using(self._context):"},{"line_number":78,"context_line":"            query \u003d self._context.session.query(models_v2.Subnet)"},{"line_number":79,"context_line":"            subnets \u003d query.filter_by(subnetpool_id\u003dself._subnetpool[\u0027id\u0027])"},{"line_number":80,"context_line":"            return (x.cidr for x in subnets)"}],"source_content_type":"text/x-python","patch_set":36,"id":"1a430d35_cb6ba31c","line":77,"range":{"start_line":77,"start_character":8,"end_line":77,"end_character":64},"updated":"2017-02-08 16:39:54.000000000","message":"shouldn\u0027t be better to use a decorator for this method?","commit_id":"a67b535aadbdcfc2e1096052721ae6297cb9ee7c"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"a8bf4eafe0952852694e48f8071f14898806d6a3","unresolved":false,"context_lines":[{"line_number":74,"context_line":"                                      subnet_pool_id\u003dself._subnetpool[\u0027id\u0027]))"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def _get_allocated_cidrs(self):"},{"line_number":77,"context_line":"        with db_api.context_manager.reader.using(self._context):"},{"line_number":78,"context_line":"            query \u003d self._context.session.query(models_v2.Subnet)"},{"line_number":79,"context_line":"            subnets \u003d query.filter_by(subnetpool_id\u003dself._subnetpool[\u0027id\u0027])"},{"line_number":80,"context_line":"            return (x.cidr for x in subnets)"}],"source_content_type":"text/x-python","patch_set":36,"id":"1a430d35_490f9f36","line":77,"range":{"start_line":77,"start_character":8,"end_line":77,"end_character":64},"in_reply_to":"1a430d35_cb6ba31c","updated":"2017-02-09 10:00:52.000000000","message":"The context here is hidden in self._context, we can use decorator only for methods which have context as first argument passed.","commit_id":"a67b535aadbdcfc2e1096052721ae6297cb9ee7c"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"122152a39186f9fc598bfd96e0e4ec8eeb7a4242","unresolved":false,"context_lines":[{"line_number":121,"context_line":"                raise n_exc.SubnetPoolQuotaExceeded()"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _allocate_any_subnet(self, request):"},{"line_number":124,"context_line":"        with db_api.context_manager.writer.using(self._context):"},{"line_number":125,"context_line":"            self._lock_subnetpool()"},{"line_number":126,"context_line":"            self._check_subnetpool_tenant_quota(request.tenant_id,"},{"line_number":127,"context_line":"                                                request.prefixlen)"}],"source_content_type":"text/x-python","patch_set":36,"id":"1a430d35_4bf4135a","line":124,"range":{"start_line":124,"start_character":13,"end_line":124,"end_character":19},"updated":"2017-02-08 16:39:54.000000000","message":"ditto: line 77","commit_id":"a67b535aadbdcfc2e1096052721ae6297cb9ee7c"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"a8bf4eafe0952852694e48f8071f14898806d6a3","unresolved":false,"context_lines":[{"line_number":121,"context_line":"                raise n_exc.SubnetPoolQuotaExceeded()"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _allocate_any_subnet(self, request):"},{"line_number":124,"context_line":"        with db_api.context_manager.writer.using(self._context):"},{"line_number":125,"context_line":"            self._lock_subnetpool()"},{"line_number":126,"context_line":"            self._check_subnetpool_tenant_quota(request.tenant_id,"},{"line_number":127,"context_line":"                                                request.prefixlen)"}],"source_content_type":"text/x-python","patch_set":36,"id":"1a430d35_a9000303","line":124,"range":{"start_line":124,"start_character":13,"end_line":124,"end_character":19},"in_reply_to":"1a430d35_4bf4135a","updated":"2017-02-09 10:00:52.000000000","message":"the same","commit_id":"a67b535aadbdcfc2e1096052721ae6297cb9ee7c"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"122152a39186f9fc598bfd96e0e4ec8eeb7a4242","unresolved":false,"context_lines":[{"line_number":145,"context_line":"                                              str(request.prefixlen))"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    def _allocate_specific_subnet(self, request):"},{"line_number":148,"context_line":"        with db_api.context_manager.writer.using(self._context):"},{"line_number":149,"context_line":"            self._lock_subnetpool()"},{"line_number":150,"context_line":"            self._check_subnetpool_tenant_quota(request.tenant_id,"},{"line_number":151,"context_line":"                                                request.prefixlen)"}],"source_content_type":"text/x-python","patch_set":36,"id":"1a430d35_6bb54f7c","line":148,"range":{"start_line":148,"start_character":13,"end_line":148,"end_character":19},"updated":"2017-02-08 16:39:54.000000000","message":"ditto: line 77","commit_id":"a67b535aadbdcfc2e1096052721ae6297cb9ee7c"}],"neutron/plugins/ml2/db.py":[{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"122152a39186f9fc598bfd96e0e4ec8eeb7a4242","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"def add_port_binding(context, port_id):"},{"line_number":45,"context_line":"    with db_api.context_manager.writer.using(context):"},{"line_number":46,"context_line":"        record \u003d models.PortBinding("},{"line_number":47,"context_line":"            port_id\u003dport_id,"},{"line_number":48,"context_line":"            vif_type\u003dportbindings.VIF_TYPE_UNBOUND)"}],"source_content_type":"text/x-python","patch_set":36,"id":"1a430d35_6b6c6f08","line":45,"range":{"start_line":45,"start_character":9,"end_line":45,"end_character":15},"updated":"2017-02-08 16:39:54.000000000","message":"Not sure if this is also a case where the decorator can be used.","commit_id":"a67b535aadbdcfc2e1096052721ae6297cb9ee7c"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"a8bf4eafe0952852694e48f8071f14898806d6a3","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"def add_port_binding(context, port_id):"},{"line_number":45,"context_line":"    with db_api.context_manager.writer.using(context):"},{"line_number":46,"context_line":"        record \u003d models.PortBinding("},{"line_number":47,"context_line":"            port_id\u003dport_id,"},{"line_number":48,"context_line":"            vif_type\u003dportbindings.VIF_TYPE_UNBOUND)"}],"source_content_type":"text/x-python","patch_set":36,"id":"1a430d35_8c1c356b","line":45,"range":{"start_line":45,"start_character":9,"end_line":45,"end_character":15},"in_reply_to":"1a430d35_6b6c6f08","updated":"2017-02-09 10:00:52.000000000","message":"yes, here can be used decorator.","commit_id":"a67b535aadbdcfc2e1096052721ae6297cb9ee7c"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"122152a39186f9fc598bfd96e0e4ec8eeb7a4242","unresolved":false,"context_lines":[{"line_number":120,"context_line":""},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"def ensure_distributed_port_binding(context, port_id, host, router_id\u003dNone):"},{"line_number":123,"context_line":"    with db_api.context_manager.reader.using(context):"},{"line_number":124,"context_line":"        record \u003d (context.session.query(models.DistributedPortBinding)."},{"line_number":125,"context_line":"                  filter_by(port_id\u003dport_id, host\u003dhost).first())"},{"line_number":126,"context_line":"    if record:"}],"source_content_type":"text/x-python","patch_set":36,"id":"1a430d35_4b37b3fe","line":123,"range":{"start_line":123,"start_character":32,"end_line":123,"end_character":38},"updated":"2017-02-08 16:39:54.000000000","message":"given that it\u0027s an inner writer, it\u0027s not necessary to switch to writer?","commit_id":"a67b535aadbdcfc2e1096052721ae6297cb9ee7c"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"a8bf4eafe0952852694e48f8071f14898806d6a3","unresolved":false,"context_lines":[{"line_number":120,"context_line":""},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"def ensure_distributed_port_binding(context, port_id, host, router_id\u003dNone):"},{"line_number":123,"context_line":"    with db_api.context_manager.reader.using(context):"},{"line_number":124,"context_line":"        record \u003d (context.session.query(models.DistributedPortBinding)."},{"line_number":125,"context_line":"                  filter_by(port_id\u003dport_id, host\u003dhost).first())"},{"line_number":126,"context_line":"    if record:"}],"source_content_type":"text/x-python","patch_set":36,"id":"1a430d35_e9312ba3","line":123,"range":{"start_line":123,"start_character":32,"end_line":123,"end_character":38},"in_reply_to":"1a430d35_4b37b3fe","updated":"2017-02-09 10:00:52.000000000","message":"We can not switch from reader to writer, but using reader inside writer is fine.","commit_id":"a67b535aadbdcfc2e1096052721ae6297cb9ee7c"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"122152a39186f9fc598bfd96e0e4ec8eeb7a4242","unresolved":false,"context_lines":[{"line_number":157,"context_line":"    with db_api.context_manager.reader.using(context):"},{"line_number":158,"context_line":"        try:"},{"line_number":159,"context_line":"            record \u003d (context.session.query(models_v2.Port)."},{"line_number":160,"context_line":"                      enable_eagerloads(True)."},{"line_number":161,"context_line":"                      filter(models_v2.Port.id.startswith(port_id))."},{"line_number":162,"context_line":"                      one())"},{"line_number":163,"context_line":"            return record"}],"source_content_type":"text/x-python","patch_set":36,"id":"1a430d35_cb0ac325","line":160,"range":{"start_line":160,"start_character":40,"end_line":160,"end_character":44},"updated":"2017-02-08 16:39:54.000000000","message":"What\u0027s the reason behind this change?","commit_id":"a67b535aadbdcfc2e1096052721ae6297cb9ee7c"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"a8bf4eafe0952852694e48f8071f14898806d6a3","unresolved":false,"context_lines":[{"line_number":157,"context_line":"    with db_api.context_manager.reader.using(context):"},{"line_number":158,"context_line":"        try:"},{"line_number":159,"context_line":"            record \u003d (context.session.query(models_v2.Port)."},{"line_number":160,"context_line":"                      enable_eagerloads(True)."},{"line_number":161,"context_line":"                      filter(models_v2.Port.id.startswith(port_id))."},{"line_number":162,"context_line":"                      one())"},{"line_number":163,"context_line":"            return record"}],"source_content_type":"text/x-python","patch_set":36,"id":"1a430d35_8c1fd5b5","line":160,"range":{"start_line":160,"start_character":40,"end_line":160,"end_character":44},"in_reply_to":"1a430d35_cb0ac325","updated":"2017-02-09 10:00:52.000000000","message":"It prevents loading relationships, so we got DetachedInstanceError later. I will put comment here.","commit_id":"a67b535aadbdcfc2e1096052721ae6297cb9ee7c"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"8bb6b3644044cb3637fbac3f91f008cc50c26dc2","unresolved":false,"context_lines":[{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    with db_api.context_manager.reader.using(context):"},{"line_number":158,"context_line":"        try:"},{"line_number":159,"context_line":"            # Set enable_eagerloads to True, so that later relationships can be"},{"line_number":160,"context_line":"            # accessed later."},{"line_number":161,"context_line":"            record \u003d (context.session.query(models_v2.Port)."},{"line_number":162,"context_line":"                      enable_eagerloads(True)."}],"source_content_type":"text/x-python","patch_set":39,"id":"fa31d9ce_25b9ec79","line":159,"range":{"start_line":159,"start_character":53,"end_line":159,"end_character":72},"updated":"2017-02-14 14:34:11.000000000","message":"later relationships? what\u0027s that? you mean lazy-by-default?","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"bc5ed5e37706ea62a3a58223628311d6becb3d78","unresolved":false,"context_lines":[{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    with db_api.context_manager.reader.using(context):"},{"line_number":158,"context_line":"        try:"},{"line_number":159,"context_line":"            # Set enable_eagerloads to True, so that later relationships can be"},{"line_number":160,"context_line":"            # accessed later."},{"line_number":161,"context_line":"            record \u003d (context.session.query(models_v2.Port)."},{"line_number":162,"context_line":"                      enable_eagerloads(True)."}],"source_content_type":"text/x-python","patch_set":39,"id":"fa31d9ce_c982cac7","line":159,"range":{"start_line":159,"start_character":53,"end_line":159,"end_character":72},"in_reply_to":"fa31d9ce_25b9ec79","updated":"2017-02-15 07:22:48.000000000","message":"Done","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"8bb6b3644044cb3637fbac3f91f008cc50c26dc2","unresolved":false,"context_lines":[{"line_number":257,"context_line":"    return query.host"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"@db_api.context_manager.writer"},{"line_number":261,"context_line":"def generate_distributed_port_status(context, port_id):"},{"line_number":262,"context_line":"    # an OR\u0027ed value of status assigned to parent port from the"},{"line_number":263,"context_line":"    # distributedportbinding bucket"}],"source_content_type":"text/x-python","patch_set":39,"id":"fa31d9ce_85045818","line":260,"range":{"start_line":260,"start_character":24,"end_line":260,"end_character":30},"updated":"2017-02-14 14:34:11.000000000","message":"why is it a writer? I see read operations only.","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"bc5ed5e37706ea62a3a58223628311d6becb3d78","unresolved":false,"context_lines":[{"line_number":257,"context_line":"    return query.host"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"@db_api.context_manager.writer"},{"line_number":261,"context_line":"def generate_distributed_port_status(context, port_id):"},{"line_number":262,"context_line":"    # an OR\u0027ed value of status assigned to parent port from the"},{"line_number":263,"context_line":"    # distributedportbinding bucket"}],"source_content_type":"text/x-python","patch_set":39,"id":"fa31d9ce_e985cece","line":260,"range":{"start_line":260,"start_character":24,"end_line":260,"end_character":30},"in_reply_to":"fa31d9ce_85045818","updated":"2017-02-15 07:22:48.000000000","message":"Done","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"df9f95a961ae993d1aa70dc1dbbb08768ee55bed","unresolved":false,"context_lines":[{"line_number":759,"context_line":"                net_db[az_ext.AZ_HINTS] \u003d az_hints"},{"line_number":760,"context_line":"                result[az_ext.AZ_HINTS] \u003d az_hints"},{"line_number":761,"context_line":""},{"line_number":762,"context_line":"            self._apply_dict_extend_functions(\u0027networks\u0027, result, net_db)"},{"line_number":763,"context_line":"        return result, mech_context"},{"line_number":764,"context_line":""},{"line_number":765,"context_line":"    @utils.transaction_guard"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_260ab179","line":762,"updated":"2017-01-17 18:54:26.000000000","message":"I guess there is a valid reason to move all those extension calls under a transaction, but I can\u0027t figure it out from the commit message.","commit_id":"41ead5386819d890e06736defb34abc8197b468d"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"50e02d1c1a030a0efbb9dc1ac8c71f8536eeadac","unresolved":false,"context_lines":[{"line_number":759,"context_line":"                net_db[az_ext.AZ_HINTS] \u003d az_hints"},{"line_number":760,"context_line":"                result[az_ext.AZ_HINTS] \u003d az_hints"},{"line_number":761,"context_line":""},{"line_number":762,"context_line":"            self._apply_dict_extend_functions(\u0027networks\u0027, result, net_db)"},{"line_number":763,"context_line":"        return result, mech_context"},{"line_number":764,"context_line":""},{"line_number":765,"context_line":"    @utils.transaction_guard"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_7cb8972a","line":762,"in_reply_to":"7a3c09a3_260ab179","updated":"2017-01-18 15:37:32.000000000","message":"The reason is that extension should have access to the DB to fetch its extra DB data.","commit_id":"41ead5386819d890e06736defb34abc8197b468d"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"df9f95a961ae993d1aa70dc1dbbb08768ee55bed","unresolved":false,"context_lines":[{"line_number":832,"context_line":""},{"line_number":833,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":834,"context_line":"    def get_network(self, context, id, fields\u003dNone):"},{"line_number":835,"context_line":"        with db_api.context_manager.writer.using(context):"},{"line_number":836,"context_line":"            result \u003d super(Ml2Plugin, self).get_network(context, id, None)"},{"line_number":837,"context_line":"            self.type_manager.extend_network_dict_provider(context, result)"},{"line_number":838,"context_line":"            result[api.MTU] \u003d self._get_network_mtu(result)"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_e67a69f0","line":835,"updated":"2017-01-17 18:54:26.000000000","message":"reader?","commit_id":"41ead5386819d890e06736defb34abc8197b468d"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"5ef00cf47a87912bc2c6fe6b2c419fbee9956e22","unresolved":false,"context_lines":[{"line_number":832,"context_line":""},{"line_number":833,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":834,"context_line":"    def get_network(self, context, id, fields\u003dNone):"},{"line_number":835,"context_line":"        with db_api.context_manager.writer.using(context):"},{"line_number":836,"context_line":"            result \u003d super(Ml2Plugin, self).get_network(context, id, None)"},{"line_number":837,"context_line":"            self.type_manager.extend_network_dict_provider(context, result)"},{"line_number":838,"context_line":"            result[api.MTU] \u003d self._get_network_mtu(result)"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_bd2e8fa2","line":835,"in_reply_to":"7a3c09a3_e67a69f0","updated":"2017-01-18 12:14:42.000000000","message":"Done","commit_id":"41ead5386819d890e06736defb34abc8197b468d"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"df9f95a961ae993d1aa70dc1dbbb08768ee55bed","unresolved":false,"context_lines":[{"line_number":842,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":843,"context_line":"    def get_networks(self, context, filters\u003dNone, fields\u003dNone,"},{"line_number":844,"context_line":"                     sorts\u003dNone, limit\u003dNone, marker\u003dNone, page_reverse\u003dFalse):"},{"line_number":845,"context_line":"        with db_api.context_manager.writer.using(context):"},{"line_number":846,"context_line":"            nets \u003d super(Ml2Plugin,"},{"line_number":847,"context_line":"                         self).get_networks(context, filters, None, sorts,"},{"line_number":848,"context_line":"                                            limit, marker, page_reverse)"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_068055bf","line":845,"updated":"2017-01-17 18:54:26.000000000","message":"reader?","commit_id":"41ead5386819d890e06736defb34abc8197b468d"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"5ef00cf47a87912bc2c6fe6b2c419fbee9956e22","unresolved":false,"context_lines":[{"line_number":842,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":843,"context_line":"    def get_networks(self, context, filters\u003dNone, fields\u003dNone,"},{"line_number":844,"context_line":"                     sorts\u003dNone, limit\u003dNone, marker\u003dNone, page_reverse\u003dFalse):"},{"line_number":845,"context_line":"        with db_api.context_manager.writer.using(context):"},{"line_number":846,"context_line":"            nets \u003d super(Ml2Plugin,"},{"line_number":847,"context_line":"                         self).get_networks(context, filters, None, sorts,"},{"line_number":848,"context_line":"                                            limit, marker, page_reverse)"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_dd299b9c","line":845,"in_reply_to":"7a3c09a3_068055bf","updated":"2017-01-18 12:14:42.000000000","message":"Done","commit_id":"41ead5386819d890e06736defb34abc8197b468d"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"8bb6b3644044cb3637fbac3f91f008cc50c26dc2","unresolved":false,"context_lines":[{"line_number":1669,"context_line":"    @db_api.retry_if_session_inactive(context_var_name\u003d\u0027plugin_context\u0027)"},{"line_number":1670,"context_line":"    def get_bound_port_context(self, plugin_context, port_id, host\u003dNone,"},{"line_number":1671,"context_line":"                               cached_networks\u003dNone):"},{"line_number":1672,"context_line":"        with db_api.context_manager.writer.using(plugin_context) as session:"},{"line_number":1673,"context_line":"            try:"},{"line_number":1674,"context_line":"                port_db \u003d (session.query(models_v2.Port)."},{"line_number":1675,"context_line":"                           enable_eagerloads(False)."}],"source_content_type":"text/x-python","patch_set":39,"id":"fa31d9ce_d0ea900e","line":1672,"updated":"2017-02-14 14:34:11.000000000","message":"reader? I don\u0027t see where we write.","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"bc5ed5e37706ea62a3a58223628311d6becb3d78","unresolved":false,"context_lines":[{"line_number":1669,"context_line":"    @db_api.retry_if_session_inactive(context_var_name\u003d\u0027plugin_context\u0027)"},{"line_number":1670,"context_line":"    def get_bound_port_context(self, plugin_context, port_id, host\u003dNone,"},{"line_number":1671,"context_line":"                               cached_networks\u003dNone):"},{"line_number":1672,"context_line":"        with db_api.context_manager.writer.using(plugin_context) as session:"},{"line_number":1673,"context_line":"            try:"},{"line_number":1674,"context_line":"                port_db \u003d (session.query(models_v2.Port)."},{"line_number":1675,"context_line":"                           enable_eagerloads(False)."}],"source_content_type":"text/x-python","patch_set":39,"id":"fa31d9ce_c9d00acc","line":1672,"in_reply_to":"fa31d9ce_d0ea900e","updated":"2017-02-15 07:22:48.000000000","message":"Done","commit_id":"c634355201d8ecad523d921fbbd8a817f530d3a9"}],"neutron/services/segments/db.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"df9f95a961ae993d1aa70dc1dbbb08768ee55bed","unresolved":false,"context_lines":[{"line_number":77,"context_line":"            raise n_exc.NetworkNotFound(net_id\u003dsegment[\u0027network_id\u0027])"},{"line_number":78,"context_line":"        registry.notify(resources.SEGMENT, events.AFTER_CREATE, self,"},{"line_number":79,"context_line":"                        context\u003dcontext, segment\u003dnew_segment)"},{"line_number":80,"context_line":"        context.session.add(new_segment)"},{"line_number":81,"context_line":"        return self._make_segment_dict(new_segment)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def _create_segment_db(self, context, segment_id, segment):"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_a6a86121","line":80,"updated":"2017-01-17 18:54:26.000000000","message":"I guess that bears an explanation of the rationale for the change. Doesn\u0027t line 121 do the same?","commit_id":"41ead5386819d890e06736defb34abc8197b468d"}],"neutron/tests/unit/plugins/ml2/test_plugin.py":[{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"122152a39186f9fc598bfd96e0e4ec8eeb7a4242","unresolved":false,"context_lines":[{"line_number":1441,"context_line":"                                            {\u0027subnet_id\u0027: s[\u0027subnet\u0027][\u0027id\u0027]})"},{"line_number":1442,"context_line":""},{"line_number":1443,"context_line":"        # lie to turn the port into an SNAT interface"},{"line_number":1444,"context_line":"        with db_api.context_manager.writer.using(self.context):"},{"line_number":1445,"context_line":"            rp \u003d self.context.session.query(l3_models.RouterPort).filter_by("},{"line_number":1446,"context_line":"                port_id\u003dp[\u0027port_id\u0027]).first()"},{"line_number":1447,"context_line":"            rp.port_type \u003d constants.DEVICE_OWNER_ROUTER_SNAT"}],"source_content_type":"text/x-python","patch_set":36,"id":"1a430d35_aeeae5d8","line":1444,"range":{"start_line":1444,"start_character":36,"end_line":1444,"end_character":42},"updated":"2017-02-08 16:39:54.000000000","message":"isn\u0027t this a reader?","commit_id":"a67b535aadbdcfc2e1096052721ae6297cb9ee7c"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"a8bf4eafe0952852694e48f8071f14898806d6a3","unresolved":false,"context_lines":[{"line_number":1441,"context_line":"                                            {\u0027subnet_id\u0027: s[\u0027subnet\u0027][\u0027id\u0027]})"},{"line_number":1442,"context_line":""},{"line_number":1443,"context_line":"        # lie to turn the port into an SNAT interface"},{"line_number":1444,"context_line":"        with db_api.context_manager.writer.using(self.context):"},{"line_number":1445,"context_line":"            rp \u003d self.context.session.query(l3_models.RouterPort).filter_by("},{"line_number":1446,"context_line":"                port_id\u003dp[\u0027port_id\u0027]).first()"},{"line_number":1447,"context_line":"            rp.port_type \u003d constants.DEVICE_OWNER_ROUTER_SNAT"}],"source_content_type":"text/x-python","patch_set":36,"id":"1a430d35_c9be2f64","line":1444,"range":{"start_line":1444,"start_character":36,"end_line":1444,"end_character":42},"in_reply_to":"1a430d35_aeeae5d8","updated":"2017-02-09 10:00:52.000000000","message":"Done","commit_id":"a67b535aadbdcfc2e1096052721ae6297cb9ee7c"}]}
