)]}'
{"nova/objects/migration_context.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3fee89e30e059a17c1732327379047daf2aabcfa","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        Based on the ``migration_id`` in this context, gets the Migration"},{"line_number":129,"context_line":"        object and returns its ``cross_cell_move`` value."},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"        The result is cached for subsequent lookups."},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        :return: True if this is a cross cell move migration, False otherwise."},{"line_number":134,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"3fa7e38b_507d996b","line":131,"range":{"start_line":131,"start_character":22,"end_line":131,"end_character":28},"updated":"2019-12-16 11:26:05.000000000","message":"Will this function be called periodically on the same MigrationContext? Or why we need the cache?\n\nI\u0027m a bit worry about cache invalidation here. When the Migration is first created the cross_cell_move is defaulted to False and then later it is set to True in the conductor migration task. So in theory this cache could be invalid if filled between the two. In reality it is pretty short time window between MigrationTask._preallocate_migration() and CrossCellMigrationTask.execute() so right now it does not cause a problem. But as this is a public method on the MigrationContext object I worry about possible future use. \n\nDo we really need to cache?","commit_id":"dae920defaeaa90bf3cac4e27d0dac41de5a1e36"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dfed842bbfc5ad7ee519c1e84507c76f8904b6dd","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        Based on the ``migration_id`` in this context, gets the Migration"},{"line_number":129,"context_line":"        object and returns its ``cross_cell_move`` value."},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"        The result is cached for subsequent lookups."},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        :return: True if this is a cross cell move migration, False otherwise."},{"line_number":134,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"3fa7e38b_0536fee9","line":131,"range":{"start_line":131,"start_character":22,"end_line":131,"end_character":28},"in_reply_to":"3fa7e38b_4ad72524","updated":"2019-12-16 15:13:59.000000000","message":"Done in https://review.opendev.org/#/c/698935/","commit_id":"dae920defaeaa90bf3cac4e27d0dac41de5a1e36"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b6bd775f65bb3bdfcd9ab824a2cfa7b14f396b05","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        Based on the ``migration_id`` in this context, gets the Migration"},{"line_number":129,"context_line":"        object and returns its ``cross_cell_move`` value."},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"        The result is cached for subsequent lookups."},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        :return: True if this is a cross cell move migration, False otherwise."},{"line_number":134,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"3fa7e38b_df8c35da","line":131,"range":{"start_line":131,"start_character":22,"end_line":131,"end_character":28},"in_reply_to":"3fa7e38b_507d996b","updated":"2019-12-16 14:25:16.000000000","message":"At this point I don\u0027t remember why I cached it except I knew it wouldn\u0027t change once it\u0027s set to True as you noted, but I see your point about future potential abuse. I can remove the cache in a FUP if that works for you.","commit_id":"dae920defaeaa90bf3cac4e27d0dac41de5a1e36"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"764b4153bb3fbc1fe0c0792e2caf3a097c98f4ac","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        Based on the ``migration_id`` in this context, gets the Migration"},{"line_number":129,"context_line":"        object and returns its ``cross_cell_move`` value."},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"        The result is cached for subsequent lookups."},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        :return: True if this is a cross cell move migration, False otherwise."},{"line_number":134,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"3fa7e38b_4ad72524","line":131,"range":{"start_line":131,"start_character":22,"end_line":131,"end_character":28},"in_reply_to":"3fa7e38b_df8c35da","updated":"2019-12-16 14:49:47.000000000","message":"BTW, I got the idea for caching from the Migration.instance property which caches the Instance once loaded.\n\nhttps://github.com/openstack/nova/blob/fd404c8d7b4a5f9a10949a3b1d2dc0dabc1b9227/nova/objects/migration.py#L194","commit_id":"dae920defaeaa90bf3cac4e27d0dac41de5a1e36"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"2f29b5f5006ebf1db88d8a5c2436299493969b30","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        if not hasattr(self, \u0027_cached_cross_cell_move\u0027):"},{"line_number":136,"context_line":"            migration \u003d objects.Migration.get_by_id("},{"line_number":137,"context_line":"                self._context, self.migration_id)"},{"line_number":138,"context_line":"            setattr(self, \u0027_cached_cross_cell_move\u0027, migration.cross_cell_move)"},{"line_number":139,"context_line":"        return self._cached_cross_cell_move"}],"source_content_type":"text/x-python","patch_set":15,"id":"3fa7e38b_679cb60c","line":138,"updated":"2019-12-13 12:14:15.000000000","message":"I assume this is necessary (vs. self.foo \u003d bar) because o.v.o","commit_id":"dae920defaeaa90bf3cac4e27d0dac41de5a1e36"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7b09f513d289fe025bad5ebd7b67bcc0998bd60d","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        if not hasattr(self, \u0027_cached_cross_cell_move\u0027):"},{"line_number":136,"context_line":"            migration \u003d objects.Migration.get_by_id("},{"line_number":137,"context_line":"                self._context, self.migration_id)"},{"line_number":138,"context_line":"            setattr(self, \u0027_cached_cross_cell_move\u0027, migration.cross_cell_move)"},{"line_number":139,"context_line":"        return self._cached_cross_cell_move"}],"source_content_type":"text/x-python","patch_set":15,"id":"3fa7e38b_bc016009","line":138,"in_reply_to":"3fa7e38b_679cb60c","updated":"2019-12-13 14:41:05.000000000","message":"Looking back at this now I\u0027m not sure why I did it this way. The Migration object does something similar but doesn\u0027t use setattr:\n\nhttps://github.com/openstack/nova/blob/master/nova/objects/migration.py#L196\n\nSo...idk. I can change it in a FUP if it\u0027s a problem.","commit_id":"dae920defaeaa90bf3cac4e27d0dac41de5a1e36"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"e556a5960b676e7deffcc33e096d1b91c97ff6f2","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        if not hasattr(self, \u0027_cached_cross_cell_move\u0027):"},{"line_number":136,"context_line":"            migration \u003d objects.Migration.get_by_id("},{"line_number":137,"context_line":"                self._context, self.migration_id)"},{"line_number":138,"context_line":"            setattr(self, \u0027_cached_cross_cell_move\u0027, migration.cross_cell_move)"},{"line_number":139,"context_line":"        return self._cached_cross_cell_move"}],"source_content_type":"text/x-python","patch_set":15,"id":"3fa7e38b_cf3d8029","line":138,"in_reply_to":"3fa7e38b_bc016009","updated":"2019-12-13 15:09:51.000000000","message":"I don\u0027t mind. More curiosity than anything","commit_id":"dae920defaeaa90bf3cac4e27d0dac41de5a1e36"}],"nova/tests/unit/virt/libvirt/test_driver.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5473fa676b8abcfa8b27b234af61ff5cb555a2a4","unresolved":false,"context_lines":[{"line_number":20423,"context_line":"                      \u0027resources\u0027]:"},{"line_number":20424,"context_line":"            setattr(instance, field, None)"},{"line_number":20425,"context_line":""},{"line_number":20426,"context_line":"        # fake_instance.fake_instance_obj drops nulls migration_context so set"},{"line_number":20427,"context_line":"        # it here."},{"line_number":20428,"context_line":"        instance.migration_context \u003d params.get(\u0027migration_context\u0027)"},{"line_number":20429,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_30a5da9f","line":20426,"range":{"start_line":20426,"start_character":42,"end_line":20426,"end_character":47},"updated":"2019-10-29 21:44:22.000000000","message":"nix this","commit_id":"b1226b31d30b3529fbdcc1cdb4a72cb923ecb70b"}]}
