)]}'
{"neutron_lib/context.py":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"5a3ff4dce0b416b6bb7370ef1949deb1d08da2a0","unresolved":true,"context_lines":[{"line_number":150,"context_line":"            if self._session:"},{"line_number":151,"context_line":"                warnings.warn(\u0027context.session is used with and without \u0027"},{"line_number":152,"context_line":"                              \u0027new enginefacade. Please update the code to \u0027"},{"line_number":153,"context_line":"                              \u0027use new enginefacede consistently.\u0027,"},{"line_number":154,"context_line":"                              DeprecationWarning)"},{"line_number":155,"context_line":"            return super().session"},{"line_number":156,"context_line":"        if self._session is None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"b925f2f9_8e2fcf9a","side":"PARENT","line":153,"updated":"2021-04-08 17:06:10.000000000","message":"This is not 100% accurate. Context \u003c-- ContextBaseWithSession, and ContextBaseWithSession has the \"transaction_context_provider\" decorator. This decorator adds the \u0027session\u0027, \u0027connection\u0027 and \u0027transaction\u0027 attributes to the class, if there is an ongoing transaction. If not, \"session\" won\u0027t be set and then, Context.session (property) can create a new writer session and return it.\n\nThis method should be fixed in a different way:\n\n    @property\n    def session(self):\n        if self._session:\n            return self._session\n\n        try:\n            self._session \u003d getattr(super(), \u0027session\u0027)\n        except exception.NoEngineContextEstablished:\n            if not self._session:\n                self._session \u003d db_api.get_writer_session()\n        return self._session","commit_id":"f01b2e9025d33aeff3bf22ea2568bda036878819"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"34867e5aa052669d81330a9a1c6fcfa49cbd44ee","unresolved":true,"context_lines":[{"line_number":150,"context_line":"            if self._session:"},{"line_number":151,"context_line":"                warnings.warn(\u0027context.session is used with and without \u0027"},{"line_number":152,"context_line":"                              \u0027new enginefacade. Please update the code to \u0027"},{"line_number":153,"context_line":"                              \u0027use new enginefacede consistently.\u0027,"},{"line_number":154,"context_line":"                              DeprecationWarning)"},{"line_number":155,"context_line":"            return super().session"},{"line_number":156,"context_line":"        if self._session is None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fb2b3a8_9e6c83da","side":"PARENT","line":153,"in_reply_to":"0b1063d3_23747a36","updated":"2021-04-16 14:29:53.000000000","message":"I found that the code provided is not correct. If the instance has \"session\", we need always to return it. When using devstack to deploy an env, I had a problem every time I was trying to create a router, in \"_create_router_db\", when the method was notifying the precommit event. In [1], the context session was not active (?? I don\u0027t understand why, we are still in a transaction)\n\nThis patch should only remove the comment in L147-148 (is not correct) and L150-154.\n\n\n[1]https://github.com/openstack/neutron/blob/1ad9ca56b07ffdc9f7e0bc6a62af61961b9128eb/neutron/db/l3_attrs_db.py#L58","commit_id":"f01b2e9025d33aeff3bf22ea2568bda036878819"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4a77fc8954dca177209aa15c6882408a106de373","unresolved":true,"context_lines":[{"line_number":150,"context_line":"            if self._session:"},{"line_number":151,"context_line":"                warnings.warn(\u0027context.session is used with and without \u0027"},{"line_number":152,"context_line":"                              \u0027new enginefacade. Please update the code to \u0027"},{"line_number":153,"context_line":"                              \u0027use new enginefacede consistently.\u0027,"},{"line_number":154,"context_line":"                              DeprecationWarning)"},{"line_number":155,"context_line":"            return super().session"},{"line_number":156,"context_line":"        if self._session is None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"e3dff10a_312264a0","side":"PARENT","line":153,"in_reply_to":"0b1063d3_23747a36","updated":"2021-04-16 12:49:45.000000000","message":"Yes, You are right (as always :)) and that explains why this check really didn\u0027t worked properly and we saw warnings even when we were using new facade already.","commit_id":"f01b2e9025d33aeff3bf22ea2568bda036878819"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"c4a06c3e771f115462f7cc1530bc9a8d8ae209ae","unresolved":true,"context_lines":[{"line_number":150,"context_line":"            if self._session:"},{"line_number":151,"context_line":"                warnings.warn(\u0027context.session is used with and without \u0027"},{"line_number":152,"context_line":"                              \u0027new enginefacade. Please update the code to \u0027"},{"line_number":153,"context_line":"                              \u0027use new enginefacede consistently.\u0027,"},{"line_number":154,"context_line":"                              DeprecationWarning)"},{"line_number":155,"context_line":"            return super().session"},{"line_number":156,"context_line":"        if self._session is None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"0b1063d3_23747a36","side":"PARENT","line":153,"in_reply_to":"b925f2f9_8e2fcf9a","updated":"2021-04-08 17:07:38.000000000","message":"Sorry, I forgot this:\n\nfrom oslo_db import exception","commit_id":"f01b2e9025d33aeff3bf22ea2568bda036878819"}]}
