)]}'
{"nova/notifications/objects/flavor.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"79fdfc1535188b43514926d717e1ee1b590e1fe0","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            # we can\u0027t load the real flavor, and if we\u0027re a flavor on"},{"line_number":82,"context_line":"            # an instance then we don\u0027t want to anyway."},{"line_number":83,"context_line":"            flavor \u003d flavor.obj_clone()"},{"line_number":84,"context_line":"            flavor.projects \u003d []"},{"line_number":85,"context_line":"        self.populate_schema(flavor\u003dflavor)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def obj_make_compatible(self, primitive, target_version):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a1ff146_79e83611","line":84,"updated":"2017-03-16 11:30:00.000000000","message":"Setting projects to [] is misleading. The instance notification will contain [] instead of null. So the client could assume that this flavor has zero projects but it might not be true.\nWe cannot set the flavor.projects to None as that field is not nullable in the model. :/\nHowever we could distinguish between an instance notification that should not touch the flavor.projects and a flavor notification that can behave as is today. What do you think about this change instead? http://pastebin.com/yWarJwGi","commit_id":"7c8c579a23ab1f7ec65d1b8ebc54248d18e8cb66"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"57e26aeeee84bbbb7aba808730303407dc391afa","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            # we can\u0027t load the real flavor, and if we\u0027re a flavor on"},{"line_number":82,"context_line":"            # an instance then we don\u0027t want to anyway."},{"line_number":83,"context_line":"            flavor \u003d flavor.obj_clone()"},{"line_number":84,"context_line":"            flavor.projects \u003d []"},{"line_number":85,"context_line":"        self.populate_schema(flavor\u003dflavor)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def obj_make_compatible(self, primitive, target_version):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a1ff146_f60d0c3f","line":84,"in_reply_to":"3a1ff146_2fb11090","updated":"2017-03-16 13:34:09.000000000","message":"Let me apply that and try to reproduce the issue I was having to see.","commit_id":"7c8c579a23ab1f7ec65d1b8ebc54248d18e8cb66"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8b6cdc0c9b76863625b1d4c25f186529c8f92f84","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            # we can\u0027t load the real flavor, and if we\u0027re a flavor on"},{"line_number":82,"context_line":"            # an instance then we don\u0027t want to anyway."},{"line_number":83,"context_line":"            flavor \u003d flavor.obj_clone()"},{"line_number":84,"context_line":"            flavor.projects \u003d []"},{"line_number":85,"context_line":"        self.populate_schema(flavor\u003dflavor)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def obj_make_compatible(self, primitive, target_version):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a1ff146_efb458f3","line":84,"in_reply_to":"3a1ff146_79e83611","updated":"2017-03-16 11:34:53.000000000","message":"I realized a bug in my original paste. Here is the improved one: http://pastebin.com/e3t5mVH5","commit_id":"7c8c579a23ab1f7ec65d1b8ebc54248d18e8cb66"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e5d8aca95cc600bb90b3ca004c55ef5bd8396ced","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            # we can\u0027t load the real flavor, and if we\u0027re a flavor on"},{"line_number":82,"context_line":"            # an instance then we don\u0027t want to anyway."},{"line_number":83,"context_line":"            flavor \u003d flavor.obj_clone()"},{"line_number":84,"context_line":"            flavor.projects \u003d []"},{"line_number":85,"context_line":"        self.populate_schema(flavor\u003dflavor)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def obj_make_compatible(self, primitive, target_version):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a1ff146_fffa3fbc","line":84,"in_reply_to":"3a1ff146_df5bc32c","updated":"2017-03-16 14:26:39.000000000","message":"Let\u0027s do what you proposed as that seems less a hack than what I did in the InstancePayload.","commit_id":"7c8c579a23ab1f7ec65d1b8ebc54248d18e8cb66"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"faf60a5890ad4efafe5464fbdeca9b131657d5d5","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            # we can\u0027t load the real flavor, and if we\u0027re a flavor on"},{"line_number":82,"context_line":"            # an instance then we don\u0027t want to anyway."},{"line_number":83,"context_line":"            flavor \u003d flavor.obj_clone()"},{"line_number":84,"context_line":"            flavor.projects \u003d []"},{"line_number":85,"context_line":"        self.populate_schema(flavor\u003dflavor)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def obj_make_compatible(self, primitive, target_version):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a1ff146_2fb11090","line":84,"in_reply_to":"3a1ff146_efb458f3","updated":"2017-03-16 11:46:37.000000000","message":"and then a stupid mistake. I should really test this changes before I post them to you.:) \nSo here is the latest passing the functional tests http://pastebin.com/q3w0RVnz","commit_id":"7c8c579a23ab1f7ec65d1b8ebc54248d18e8cb66"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ee7f52bd933f6f4ba3526e3bfb459c5a7305df41","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            # we can\u0027t load the real flavor, and if we\u0027re a flavor on"},{"line_number":82,"context_line":"            # an instance then we don\u0027t want to anyway."},{"line_number":83,"context_line":"            flavor \u003d flavor.obj_clone()"},{"line_number":84,"context_line":"            flavor.projects \u003d []"},{"line_number":85,"context_line":"        self.populate_schema(flavor\u003dflavor)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def obj_make_compatible(self, primitive, target_version):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a1ff146_df5bc32c","line":84,"in_reply_to":"3a1ff146_f60d0c3f","updated":"2017-03-16 14:20:14.000000000","message":"I still get a flavor projects lazy load in the compute cell with your patch. I haven\u0027t done a bunch of debug to see where though.\n\nHowever, if I change L84 of my original patch to this:\n\n flavor._context \u003d None\n\nthen I seem to be good. That will avoid the lazy-load from the notification by orphaning the flavor we\u0027re actually using, but not affect anything on the projects list. Does that work for you?","commit_id":"7c8c579a23ab1f7ec65d1b8ebc54248d18e8cb66"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"de6c767a596e6c3e98f99e8185cd1e56fb6ef540","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            # we can\u0027t load the real flavor, and if we\u0027re a flavor on"},{"line_number":82,"context_line":"            # an instance then we don\u0027t want to anyway."},{"line_number":83,"context_line":"            flavor \u003d flavor.obj_clone()"},{"line_number":84,"context_line":"            flavor._context \u003d None"},{"line_number":85,"context_line":"        self.populate_schema(flavor\u003dflavor)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def obj_make_compatible(self, primitive, target_version):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5ff73747_47a90222","line":84,"range":{"start_line":84,"start_character":12,"end_line":84,"end_character":34},"updated":"2017-04-27 01:29:40.000000000","message":"Doesn\u0027t this just result in an OrphanedObjectError when the notification payload code tries to lazy-load flavor.projects? I guess I\u0027m not sure why this isn\u0027t blowing up.","commit_id":"5a363a0d72e7dd8d79d7e950effc1d8a5fdc801b"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"108856241206fe442284f9ff0c15a806f67da3fd","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            # we can\u0027t load the real flavor, and if we\u0027re a flavor on"},{"line_number":82,"context_line":"            # an instance then we don\u0027t want to anyway."},{"line_number":83,"context_line":"            flavor \u003d flavor.obj_clone()"},{"line_number":84,"context_line":"            flavor._context \u003d None"},{"line_number":85,"context_line":"        self.populate_schema(flavor\u003dflavor)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def obj_make_compatible(self, primitive, target_version):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_b79e3eb6","line":84,"updated":"2017-03-20 10:42:44.000000000","message":"So, that does work because projects is the only lazy-loadable Flavor field. In case someone would add a new lazy-loadable field, it could be creating a new bug, right?\n\nInstead of just verifying if projects is in the flavor, shouldn\u0027t we rather do something like :\n\n  for lazyloadable in flavor.lazy_fields:\n     if lazyloadable not in flavor:\n       \u003cclone and set _context None\u003e\n       break\n\nwhere lazy_fields would be just a Flavor property ?","commit_id":"5a363a0d72e7dd8d79d7e950effc1d8a5fdc801b"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4f4140fe5342c5a8b4f93da3715a8f6465e51455","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            # we can\u0027t load the real flavor, and if we\u0027re a flavor on"},{"line_number":82,"context_line":"            # an instance then we don\u0027t want to anyway."},{"line_number":83,"context_line":"            flavor \u003d flavor.obj_clone()"},{"line_number":84,"context_line":"            flavor._context \u003d None"},{"line_number":85,"context_line":"        self.populate_schema(flavor\u003dflavor)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def obj_make_compatible(self, primitive, target_version):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_6f7aaa89","line":84,"in_reply_to":"1a1ced50_b54ab181","updated":"2017-03-22 21:06:40.000000000","message":"Fine by me, just wanted to explain that we could possibly need to remember that if we want to add a new field added to the SCHEMA, then we would need to update that.","commit_id":"5a363a0d72e7dd8d79d7e950effc1d8a5fdc801b"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"bc33843f282b8d7ecdd1d146435f24551dd6ca00","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            # we can\u0027t load the real flavor, and if we\u0027re a flavor on"},{"line_number":82,"context_line":"            # an instance then we don\u0027t want to anyway."},{"line_number":83,"context_line":"            flavor \u003d flavor.obj_clone()"},{"line_number":84,"context_line":"            flavor._context \u003d None"},{"line_number":85,"context_line":"        self.populate_schema(flavor\u003dflavor)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def obj_make_compatible(self, primitive, target_version):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_b54ab181","line":84,"in_reply_to":"1a1ced50_b79e3eb6","updated":"2017-03-20 13:40:30.000000000","message":"It\u0027s that projects is specifically loaded by the notification code. If we added another flavor field that was lazy-loadable but didn\u0027t put it in the SCHEMA (L44) then nothing would happen.\n\nIf we did, then we\u0027d need to address this, yeah. Until we have two problematic fields I don\u0027t think it\u0027s worth making this a loop, especially since flavor very clearly only supports one lazy-loadable thing and has since inception.","commit_id":"5a363a0d72e7dd8d79d7e950effc1d8a5fdc801b"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e73d041f81a3b451b01bb3f59b2d1cb00200bbd3","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            # we can\u0027t load the real flavor, and if we\u0027re a flavor on"},{"line_number":82,"context_line":"            # an instance then we don\u0027t want to anyway."},{"line_number":83,"context_line":"            flavor \u003d flavor.obj_clone()"},{"line_number":84,"context_line":"            flavor._context \u003d None"},{"line_number":85,"context_line":"        self.populate_schema(flavor\u003dflavor)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def obj_make_compatible(self, primitive, target_version):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5ff73747_4f059413","line":84,"range":{"start_line":84,"start_character":12,"end_line":84,"end_character":34},"in_reply_to":"5ff73747_47a90222","updated":"2017-04-27 07:31:24.000000000","message":"This code orphaning the flavor then when flavor.projects is accessed the ovo will raise OrphanedObjectError. But in the notification code path this access happens only at the schema population code [1] and there the exception is handled and the payload is populated with None to signal that the information is not available.\n\n[1] https://github.com/openstack/nova/blob/29cb8f1c459e6d23dd9303fb570cee773d9c4d02/nova/notifications/objects/base.py#L107","commit_id":"5a363a0d72e7dd8d79d7e950effc1d8a5fdc801b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2957197145a474c3c741905cafa17504027d7e6c","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            # we can\u0027t load the real flavor, and if we\u0027re a flavor on"},{"line_number":82,"context_line":"            # an instance then we don\u0027t want to anyway."},{"line_number":83,"context_line":"            flavor \u003d flavor.obj_clone()"},{"line_number":84,"context_line":"            flavor._context \u003d None"},{"line_number":85,"context_line":"        self.populate_schema(flavor\u003dflavor)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def obj_make_compatible(self, primitive, target_version):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5ff73747_69eefab4","line":84,"range":{"start_line":84,"start_character":12,"end_line":84,"end_character":34},"in_reply_to":"5ff73747_4f059413","updated":"2017-04-27 15:57:28.000000000","message":"AHH I was missing that part. OK thanks.","commit_id":"5a363a0d72e7dd8d79d7e950effc1d8a5fdc801b"}],"nova/objects/flavor.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ab64f04fabbe5620c5cf8e4b1d6dfdbe4cacb3a0","unresolved":false,"context_lines":[{"line_number":605,"context_line":"                db_flavor \u003d self._flavor_destroy(self._context,"},{"line_number":606,"context_line":"                                                 flavorid\u003dself.flavorid)"},{"line_number":607,"context_line":"            self._from_db_object(self._context, self, db_flavor)"},{"line_number":608,"context_line":"            self._send_notification(fields.NotificationAction.DELETE)"},{"line_number":609,"context_line":"        except exception.FlavorNotFound:"},{"line_number":610,"context_line":"            db.flavor_destroy(self._context, self.flavorid)"},{"line_number":611,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5ff73747_6702be3f","line":608,"range":{"start_line":608,"start_character":12,"end_line":608,"end_character":69},"updated":"2017-04-27 01:23:32.000000000","message":"If we\u0027re sending the notification because we just deleted the flavor from the API database, and we didn\u0027t get the flavor with projects loaded, we\u0027re going to lazy-load them and that\u0027s going to result in a FlavorNotFound because we just deleted the flavor, which is caught on the next line and is going to make us try to delete the flavor in the cell db, which would also raise a FlavorNotFound...","commit_id":"5a363a0d72e7dd8d79d7e950effc1d8a5fdc801b"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"7d9cf821b46c9215b5032db2919aa57320d671bd","unresolved":false,"context_lines":[{"line_number":605,"context_line":"                db_flavor \u003d self._flavor_destroy(self._context,"},{"line_number":606,"context_line":"                                                 flavorid\u003dself.flavorid)"},{"line_number":607,"context_line":"            self._from_db_object(self._context, self, db_flavor)"},{"line_number":608,"context_line":"            self._send_notification(fields.NotificationAction.DELETE)"},{"line_number":609,"context_line":"        except exception.FlavorNotFound:"},{"line_number":610,"context_line":"            db.flavor_destroy(self._context, self.flavorid)"},{"line_number":611,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5ff73747_0adada4a","line":608,"range":{"start_line":608,"start_character":12,"end_line":608,"end_character":69},"in_reply_to":"5ff73747_4a17c246","updated":"2017-04-27 07:45:23.000000000","message":"Ignore my previous comment. Here we doesn\u0027t orphan the flavor object by setting the context to None so no OrphanedObjectError will be raised.","commit_id":"5a363a0d72e7dd8d79d7e950effc1d8a5fdc801b"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e73d041f81a3b451b01bb3f59b2d1cb00200bbd3","unresolved":false,"context_lines":[{"line_number":605,"context_line":"                db_flavor \u003d self._flavor_destroy(self._context,"},{"line_number":606,"context_line":"                                                 flavorid\u003dself.flavorid)"},{"line_number":607,"context_line":"            self._from_db_object(self._context, self, db_flavor)"},{"line_number":608,"context_line":"            self._send_notification(fields.NotificationAction.DELETE)"},{"line_number":609,"context_line":"        except exception.FlavorNotFound:"},{"line_number":610,"context_line":"            db.flavor_destroy(self._context, self.flavorid)"},{"line_number":611,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5ff73747_4a17c246","line":608,"range":{"start_line":608,"start_character":12,"end_line":608,"end_character":69},"in_reply_to":"5ff73747_6702be3f","updated":"2017-04-27 07:31:24.000000000","message":"Lazy load will result in OrphanedObjectError and that is handled in the notification code path.","commit_id":"5a363a0d72e7dd8d79d7e950effc1d8a5fdc801b"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"108856241206fe442284f9ff0c15a806f67da3fd","unresolved":false,"context_lines":[{"line_number":614,"context_line":"        # lazy-load projects (which is a problem for instance-bound"},{"line_number":615,"context_line":"        # flavors and compute-cell operations), just load them here."},{"line_number":616,"context_line":"        if \u0027projects\u0027 not in self:"},{"line_number":617,"context_line":"            self._load_projects()"},{"line_number":618,"context_line":"        notification_type \u003d flavor_notification.FlavorNotification"},{"line_number":619,"context_line":"        payload_type \u003d flavor_notification.FlavorPayload"},{"line_number":620,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_d741fa0c","line":617,"updated":"2017-03-20 10:42:44.000000000","message":"So, thanks to the above, we don\u0027t need to modify the unittests because we would still get the projects field.\n\nThat said, I\u0027m afraid we could be missing some verification if we add a new Flavor lazy-loadable field, hence me liking to see an explicit unittest here if possible.","commit_id":"5a363a0d72e7dd8d79d7e950effc1d8a5fdc801b"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e73d041f81a3b451b01bb3f59b2d1cb00200bbd3","unresolved":false,"context_lines":[{"line_number":614,"context_line":"        # lazy-load projects (which is a problem for instance-bound"},{"line_number":615,"context_line":"        # flavors and compute-cell operations), just load them here."},{"line_number":616,"context_line":"        if \u0027projects\u0027 not in self:"},{"line_number":617,"context_line":"            self._load_projects()"},{"line_number":618,"context_line":"        notification_type \u003d flavor_notification.FlavorNotification"},{"line_number":619,"context_line":"        payload_type \u003d flavor_notification.FlavorPayload"},{"line_number":620,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5ff73747_4a30e2e8","line":617,"in_reply_to":"1a1ced50_d741fa0c","updated":"2017-04-27 07:31:24.000000000","message":"The notification sample test would catch that problem.\n\nHowever this is interesting as this code should blow up with OrphanedObjectError. I thought the only project load happens in the schema population [1].\n\n[1]https://github.com/openstack/nova/blob/29cb8f1c459e6d23dd9303fb570cee773d9c4d02/nova/notifications/objects/base.py#L107","commit_id":"5a363a0d72e7dd8d79d7e950effc1d8a5fdc801b"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"7e48fa0276aa2c3fe1a828b41149a273d683a862","unresolved":false,"context_lines":[{"line_number":614,"context_line":"        # lazy-load projects (which is a problem for instance-bound"},{"line_number":615,"context_line":"        # flavors and compute-cell operations), just load them here."},{"line_number":616,"context_line":"        if \u0027projects\u0027 not in self:"},{"line_number":617,"context_line":"            self._load_projects()"},{"line_number":618,"context_line":"        notification_type \u003d flavor_notification.FlavorNotification"},{"line_number":619,"context_line":"        payload_type \u003d flavor_notification.FlavorPayload"},{"line_number":620,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5ff73747_12b0a389","line":617,"in_reply_to":"5ff73747_2980f2bf","updated":"2017-04-28 12:44:53.000000000","message":"The execution goes to the fallback method https://github.com/openstack/nova/blob/5a363a0d72e7dd8d79d7e950effc1d8a5fdc801b/nova/objects/flavor.py#L351 but that also use read_delete\u003dno in the db query https://github.com/openstack/nova/blob/5a363a0d72e7dd8d79d7e950effc1d8a5fdc801b/nova/db/sqlalchemy/api.py#L5122 but then this query is used in https://github.com/openstack/nova/blob/5a363a0d72e7dd8d79d7e950effc1d8a5fdc801b/nova/db/sqlalchemy/api.py#L5198 where all() is called. So if nothing is found due to the deleted flavor it will return [] instead of blowing up.\n\nThis means that even if the flavor had some projects associated then those projects will not be shown in the flavor-delete notification because the flavor is already deleted.\n\nIt would be nice to send None instead of [] in the flavor-delete notification. This is exactly what your patch https://review.openstack.org/#/c/460377/ causes.","commit_id":"5a363a0d72e7dd8d79d7e950effc1d8a5fdc801b"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"7d9cf821b46c9215b5032db2919aa57320d671bd","unresolved":false,"context_lines":[{"line_number":614,"context_line":"        # lazy-load projects (which is a problem for instance-bound"},{"line_number":615,"context_line":"        # flavors and compute-cell operations), just load them here."},{"line_number":616,"context_line":"        if \u0027projects\u0027 not in self:"},{"line_number":617,"context_line":"            self._load_projects()"},{"line_number":618,"context_line":"        notification_type \u003d flavor_notification.FlavorNotification"},{"line_number":619,"context_line":"        payload_type \u003d flavor_notification.FlavorPayload"},{"line_number":620,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5ff73747_aafac6b9","line":617,"in_reply_to":"5ff73747_4a30e2e8","updated":"2017-04-27 07:45:23.000000000","message":"Sorry my bad. There are two different scenarios.\n1) Here we send flavor notification and during that we have a  proper flavor object that can be used to lazy load flavor.projects and that happens here\n2) In the instance.\u003caction\u003e notification code path we have a Flavor object in instance.flavor and there we explicitly orphan that flavor not to load flavor.projects.","commit_id":"5a363a0d72e7dd8d79d7e950effc1d8a5fdc801b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2957197145a474c3c741905cafa17504027d7e6c","unresolved":false,"context_lines":[{"line_number":614,"context_line":"        # lazy-load projects (which is a problem for instance-bound"},{"line_number":615,"context_line":"        # flavors and compute-cell operations), just load them here."},{"line_number":616,"context_line":"        if \u0027projects\u0027 not in self:"},{"line_number":617,"context_line":"            self._load_projects()"},{"line_number":618,"context_line":"        notification_type \u003d flavor_notification.FlavorNotification"},{"line_number":619,"context_line":"        payload_type \u003d flavor_notification.FlavorPayload"},{"line_number":620,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5ff73747_2980f2bf","line":617,"in_reply_to":"5ff73747_aafac6b9","updated":"2017-04-27 15:57:28.000000000","message":"I don\u0027t understand how the flavor-delete tests don\u0027t blow up with a FlavorNotFound though, since if we delete the flavor in the API database it\u0027s gone, and we\u0027d fallback to looking it up from the main DB but it won\u0027t be there either I don\u0027t think, unless maybe we have some test fixtures doing that in the main DB - but they shouldn\u0027t be.","commit_id":"5a363a0d72e7dd8d79d7e950effc1d8a5fdc801b"}],"nova/objects/instance.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"79fdfc1535188b43514926d717e1ee1b590e1fe0","unresolved":false,"context_lines":[{"line_number":284,"context_line":"            self.old_flavor._context \u003d None"},{"line_number":285,"context_line":"        if self.obj_attr_is_set(\u0027new_flavor\u0027) and self.new_flavor:"},{"line_number":286,"context_line":"            self.new_flavor._context \u003d None"},{"line_number":287,"context_line":""},{"line_number":288,"context_line":"        return self"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a1ff146_f4826bff","side":"PARENT","line":287,"updated":"2017-03-16 11:30:00.000000000","message":"Even if we are fixing the instance notification directly, without this change the instance.flavor will not be orphaned after deserialization therefore some other than notification code still can trigger a lazy-load on instance.flavor.projects.\n\nYou mentioned in the commit message that there is still a way to have a non-orphaned flavor in instance.flavor. How can that happen? Can we change that code path to orphan the flavor there as well?","commit_id":"c0f36430ecd459dfe48c123c696cdabd5333d2fe"}]}
