)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":23598,"name":"Zhong Luyao","email":"luyao.zhong@intel.com","username":"ZhongLuyao"},"change_message_id":"7e7f9251711384efda41fb7ac03cf868b098816a","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     LuyaoZhong \u003cluyao.zhong@intel.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2020-09-02 08:31:38 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Improve orphans tracking in resource tracker"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"There are two kinds of orphans, one has db records which should be"},{"line_number":10,"context_line":"tracked until cleaned up by periodic task"},{"line_number":11,"context_line":"\u0027_cleanup_running_deleted_instances\u0027,"},{"line_number":12,"context_line":"another has no db records, we only consider its memory usage."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"In resource tracker, we get orphans usage based on"},{"line_number":15,"context_line":"\u0027get_per_instance_usage\u0027 interface, we implement it for libvirt"},{"line_number":16,"context_line":"driver."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: Ia39c32fcfa1b843c1c9eb5b73d090d9c81f3095f"},{"line_number":19,"context_line":"Partially-Implements: blueprint vpmem-enhancement"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"9f560f44_cb15904b","line":16,"range":{"start_line":7,"start_character":0,"end_line":16,"end_character":7},"updated":"2020-09-02 08:48:26.000000000","message":"forget to update commit message, in latest update, orphans are divided into 2 types:\n1. running deleted instances, they must have db records, and instance.host is equal to current host.\n2. other orphans, we name it unidentifiable_orphans temporary, since it might have no db records, or a migrating instance due to race condition which has db records.\n\nWaiting for reviewers\u0027 approvement and helping make decisions.","commit_id":"78231d8b6a832228e92393f2e171b36dabcd0ebe"}],"nova/compute/manager.py":[{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"37907fb7ebfa4e77c2b21c913282885da455eacb","unresolved":false,"context_lines":[{"line_number":10284,"context_line":"        LOG.debug(\u0027Cleaning up deleted instances\u0027)"},{"line_number":10285,"context_line":"        filters \u003d {\u0027deleted\u0027: True,"},{"line_number":10286,"context_line":"                   \u0027soft_deleted\u0027: False,"},{"line_number":10287,"context_line":"                   \u0027host\u0027: CONF.host,"},{"line_number":10288,"context_line":"                   \u0027cleaned\u0027: False}"},{"line_number":10289,"context_line":"        attrs \u003d [\u0027system_metadata\u0027]"},{"line_number":10290,"context_line":"        with utils.temporary_mutation(context, read_deleted\u003d\u0027yes\u0027):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_96d85053","line":10287,"updated":"2020-08-07 06:32:54.000000000","message":"pep8: H403: multi line docstrings should end on a new line","commit_id":"ecf8971c84d7a8b32b6f0ed5d7b66f5f277ee24f"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"37907fb7ebfa4e77c2b21c913282885da455eacb","unresolved":false,"context_lines":[{"line_number":10285,"context_line":"        filters \u003d {\u0027deleted\u0027: True,"},{"line_number":10286,"context_line":"                   \u0027soft_deleted\u0027: False,"},{"line_number":10287,"context_line":"                   \u0027host\u0027: CONF.host,"},{"line_number":10288,"context_line":"                   \u0027cleaned\u0027: False}"},{"line_number":10289,"context_line":"        attrs \u003d [\u0027system_metadata\u0027]"},{"line_number":10290,"context_line":"        with utils.temporary_mutation(context, read_deleted\u003d\u0027yes\u0027):"},{"line_number":10291,"context_line":"            instances \u003d objects.InstanceList.get_by_filters("}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_f6db8c4b","line":10288,"updated":"2020-08-07 06:32:54.000000000","message":"pep8: H403: multi line docstrings should end on a new line","commit_id":"ecf8971c84d7a8b32b6f0ed5d7b66f5f277ee24f"}],"nova/compute/resource_tracker.py":[{"author":{"_account_id":23598,"name":"Zhong Luyao","email":"luyao.zhong@intel.com","username":"ZhongLuyao"},"change_message_id":"a8e6c11b855e63541d9d50693c517855339b38d3","unresolved":false,"context_lines":[{"line_number":915,"context_line":"        self._update_usage_from_orphans(orphans, nodename)"},{"line_number":916,"context_line":""},{"line_number":917,"context_line":"        # Track orphan instances"},{"line_number":918,"context_line":"        orphan_insts \u003d objects.InstanceList.get_by_filters("},{"line_number":919,"context_line":"            context, {\u0027uuid\u0027: [orphan[\u0027uuid\u0027] for orphan in orphans]},"},{"line_number":920,"context_line":"            expected_attrs\u003d[\u0027migration_context\u0027], use_slave\u003dTrue)"},{"line_number":921,"context_line":"        for instance in orphan_insts:"},{"line_number":922,"context_line":"            migration_ctxt \u003d instance.migration_context"},{"line_number":923,"context_line":"            if not migration_ctxt:"},{"line_number":924,"context_line":"                # if the instance is not in migrating,"},{"line_number":925,"context_line":"                # it should be a tracked instance"},{"line_number":926,"context_line":"                self.tracked_instances.add(instance.uuid)"},{"line_number":927,"context_line":"                instance_by_uuid[instance.uuid] \u003d instance"},{"line_number":928,"context_line":"                continue"},{"line_number":929,"context_line":"            # if the instance is in migrating, it should be a"},{"line_number":930,"context_line":"            # tracked migration"},{"line_number":931,"context_line":"            migration \u003d objects.Migration.get_by_id_and_instance("},{"line_number":932,"context_line":"                context, migration_ctxt.migration_id, instance.uuid)"},{"line_number":933,"context_line":"            self.tracked_migrations[instance.uuid] \u003d migration"},{"line_number":934,"context_line":""},{"line_number":935,"context_line":"        cn \u003d self.compute_nodes[nodename]"},{"line_number":936,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_bb91fd49","line":933,"range":{"start_line":918,"start_character":0,"end_line":933,"end_character":62},"updated":"2020-08-07 04:53:59.000000000","message":"I add the orphan into the tracked_instances and tracked_migrations since we update assigned resources based on those records.","commit_id":"ecf8971c84d7a8b32b6f0ed5d7b66f5f277ee24f"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"43800411c8f978dad2264b11401812c9a4458500","unresolved":false,"context_lines":[{"line_number":909,"context_line":"                context, self.compute_nodes[nodename], migrations,"},{"line_number":910,"context_line":"                instance_by_uuid)"},{"line_number":911,"context_line":""},{"line_number":912,"context_line":"        # Detect and account for orphaned instances that may exist on the"},{"line_number":913,"context_line":"        # hypervisor, but are not in the DB:"},{"line_number":914,"context_line":"        orphans \u003d self._find_orphaned_instances()"},{"line_number":915,"context_line":"        self._update_usage_from_orphans(orphans, nodename)"},{"line_number":916,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_996b2ef0","line":913,"range":{"start_line":912,"start_character":8,"end_line":913,"end_character":44},"updated":"2020-08-12 04:04:59.000000000","message":"I confused on the definition of orphaned instances now. \n\nActually, the case is same with https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L9749, so we should call them running_deleted_instance?\n\nSince the orphaned instance is more like no any DB entry for it.","commit_id":"b72d7e23b661dfd188d30bf64e77d9cb8ef4de97"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"e43d9d483695e96ef15562a1af738df32ede0ac1","unresolved":false,"context_lines":[{"line_number":909,"context_line":"                context, self.compute_nodes[nodename], migrations,"},{"line_number":910,"context_line":"                instance_by_uuid)"},{"line_number":911,"context_line":""},{"line_number":912,"context_line":"        # Detect and account for orphaned instances that may exist on the"},{"line_number":913,"context_line":"        # hypervisor, but are not in the DB:"},{"line_number":914,"context_line":"        orphans \u003d self._find_orphaned_instances()"},{"line_number":915,"context_line":"        self._update_usage_from_orphans(orphans, nodename)"},{"line_number":916,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_8218c075","line":913,"range":{"start_line":912,"start_character":8,"end_line":913,"end_character":44},"in_reply_to":"9f560f44_217c5b1f","updated":"2020-08-13 14:08:43.000000000","message":"I mean this path is about the tracking running deleted instance. It isn\u0027t orphaned instance.\n\nThe running deleted instance has db entry. The orphaned instance hasn\u0027t db entry.","commit_id":"b72d7e23b661dfd188d30bf64e77d9cb8ef4de97"},{"author":{"_account_id":23598,"name":"Zhong Luyao","email":"luyao.zhong@intel.com","username":"ZhongLuyao"},"change_message_id":"277a110b2a6c3ea9262994fe4a7fdc99b856a7a2","unresolved":false,"context_lines":[{"line_number":909,"context_line":"                context, self.compute_nodes[nodename], migrations,"},{"line_number":910,"context_line":"                instance_by_uuid)"},{"line_number":911,"context_line":""},{"line_number":912,"context_line":"        # Detect and account for orphaned instances that may exist on the"},{"line_number":913,"context_line":"        # hypervisor, but are not in the DB:"},{"line_number":914,"context_line":"        orphans \u003d self._find_orphaned_instances()"},{"line_number":915,"context_line":"        self._update_usage_from_orphans(orphans, nodename)"},{"line_number":916,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_217c5b1f","line":913,"range":{"start_line":912,"start_character":8,"end_line":913,"end_character":44},"in_reply_to":"9f560f44_996b2ef0","updated":"2020-08-13 07:44:46.000000000","message":"I think orphans here is the same as running_deleted_instance, I might not get what you mean, do you mean we should rename the \u0027orphan\u0027. There is no db for orphans, but we can find orphan uuids first and get instance objects. #LINE918~920","commit_id":"b72d7e23b661dfd188d30bf64e77d9cb8ef4de97"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"43800411c8f978dad2264b11401812c9a4458500","unresolved":false,"context_lines":[{"line_number":923,"context_line":"            if not migration_ctxt:"},{"line_number":924,"context_line":"                # if the instance is not in migrating,"},{"line_number":925,"context_line":"                # it should be a tracked instance"},{"line_number":926,"context_line":"                self.tracked_instances.add(instance.uuid)"},{"line_number":927,"context_line":"                instance_by_uuid[instance.uuid] \u003d instance"},{"line_number":928,"context_line":"                continue"},{"line_number":929,"context_line":"            # if the instance is in migrating, it should be a"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_d4360de8","line":926,"range":{"start_line":926,"start_character":16,"end_line":926,"end_character":38},"updated":"2020-08-12 04:04:59.000000000","message":"so why we only add the instance to tracked_instance and tracked_migration but doesn\u0027t update the resource usage in RT.","commit_id":"b72d7e23b661dfd188d30bf64e77d9cb8ef4de97"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"e43d9d483695e96ef15562a1af738df32ede0ac1","unresolved":false,"context_lines":[{"line_number":923,"context_line":"            if not migration_ctxt:"},{"line_number":924,"context_line":"                # if the instance is not in migrating,"},{"line_number":925,"context_line":"                # it should be a tracked instance"},{"line_number":926,"context_line":"                self.tracked_instances.add(instance.uuid)"},{"line_number":927,"context_line":"                instance_by_uuid[instance.uuid] \u003d instance"},{"line_number":928,"context_line":"                continue"},{"line_number":929,"context_line":"            # if the instance is in migrating, it should be a"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_c250f80d","line":926,"range":{"start_line":926,"start_character":16,"end_line":926,"end_character":38},"in_reply_to":"9f560f44_619db365","updated":"2020-08-13 14:08:43.000000000","message":"RT is also tracking the resource like cpu, memory. For normal instance it update the usage at line 887. I\u0027m thinking we should update usage for those orphaned instance also","commit_id":"b72d7e23b661dfd188d30bf64e77d9cb8ef4de97"},{"author":{"_account_id":23598,"name":"Zhong Luyao","email":"luyao.zhong@intel.com","username":"ZhongLuyao"},"change_message_id":"277a110b2a6c3ea9262994fe4a7fdc99b856a7a2","unresolved":false,"context_lines":[{"line_number":923,"context_line":"            if not migration_ctxt:"},{"line_number":924,"context_line":"                # if the instance is not in migrating,"},{"line_number":925,"context_line":"                # it should be a tracked instance"},{"line_number":926,"context_line":"                self.tracked_instances.add(instance.uuid)"},{"line_number":927,"context_line":"                instance_by_uuid[instance.uuid] \u003d instance"},{"line_number":928,"context_line":"                continue"},{"line_number":929,"context_line":"            # if the instance is in migrating, it should be a"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_619db365","line":926,"range":{"start_line":926,"start_character":16,"end_line":926,"end_character":38},"in_reply_to":"9f560f44_d4360de8","updated":"2020-08-13 07:44:46.000000000","message":"_populate_assigned_resources will update the resource usage like vpmem in RT (only update _Provider.resources) based on tracked_instance and  tracked_migrations.\n\nresource usage updating in RT is relying on allocations, but an orphan has no allocation in db, I\u0027m not sure how we handle it, we may need get and format the allocations from instance object?","commit_id":"b72d7e23b661dfd188d30bf64e77d9cb8ef4de97"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"43800411c8f978dad2264b11401812c9a4458500","unresolved":false,"context_lines":[{"line_number":930,"context_line":"            # tracked migration"},{"line_number":931,"context_line":"            migration \u003d objects.Migration.get_by_id_and_instance("},{"line_number":932,"context_line":"                context, migration_ctxt.migration_id, instance.uuid)"},{"line_number":933,"context_line":"            self.tracked_migrations[instance.uuid] \u003d migration"},{"line_number":934,"context_line":""},{"line_number":935,"context_line":"        cn \u003d self.compute_nodes[nodename]"},{"line_number":936,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_7949fa89","line":933,"range":{"start_line":933,"start_character":12,"end_line":933,"end_character":62},"updated":"2020-08-12 04:04:59.000000000","message":"the self.tracked_migrations looks like only include the instance which\u0027s host isn\u0027t current host. https://github.com/openstack/nova/blob/master/nova/compute/resource_tracker.py#L1247\n\nShould we follow that?","commit_id":"b72d7e23b661dfd188d30bf64e77d9cb8ef4de97"},{"author":{"_account_id":23598,"name":"Zhong Luyao","email":"luyao.zhong@intel.com","username":"ZhongLuyao"},"change_message_id":"277a110b2a6c3ea9262994fe4a7fdc99b856a7a2","unresolved":false,"context_lines":[{"line_number":930,"context_line":"            # tracked migration"},{"line_number":931,"context_line":"            migration \u003d objects.Migration.get_by_id_and_instance("},{"line_number":932,"context_line":"                context, migration_ctxt.migration_id, instance.uuid)"},{"line_number":933,"context_line":"            self.tracked_migrations[instance.uuid] \u003d migration"},{"line_number":934,"context_line":""},{"line_number":935,"context_line":"        cn \u003d self.compute_nodes[nodename]"},{"line_number":936,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_61aad319","line":933,"range":{"start_line":933,"start_character":12,"end_line":933,"end_character":62},"in_reply_to":"9f560f44_7949fa89","updated":"2020-08-13 07:44:46.000000000","message":"It sounds a good suggestion.","commit_id":"b72d7e23b661dfd188d30bf64e77d9cb8ef4de97"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"5d002042bddde4c5f1b12b80dd0a1ca0d3de6df5","unresolved":false,"context_lines":[{"line_number":921,"context_line":"            # without db records"},{"line_number":922,"context_line":"            orphans_without_db \u003d [orphan for orphan in orphans"},{"line_number":923,"context_line":"                if orphan[\u0027uuid\u0027] not in orphans_with_db_by_uuid.keys()]"},{"line_number":924,"context_line":"            print(orphans_without_db)"},{"line_number":925,"context_line":"            self._update_usage_from_orphans(orphans_without_db, nodename)"},{"line_number":926,"context_line":""},{"line_number":927,"context_line":"        cn \u003d self.compute_nodes[nodename]"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_8d941539","line":924,"range":{"start_line":924,"start_character":36,"end_line":924,"end_character":37},"updated":"2020-08-20 10:53:38.000000000","message":"whoops","commit_id":"e11e560fee4d69956b0decbe2d9309e28044af5e"},{"author":{"_account_id":23598,"name":"Zhong Luyao","email":"luyao.zhong@intel.com","username":"ZhongLuyao"},"change_message_id":"820e494cddd657f76aa0312cce6ae5c40a656b79","unresolved":false,"context_lines":[{"line_number":921,"context_line":"            # without db records"},{"line_number":922,"context_line":"            orphans_without_db \u003d [orphan for orphan in orphans"},{"line_number":923,"context_line":"                if orphan[\u0027uuid\u0027] not in orphans_with_db_by_uuid.keys()]"},{"line_number":924,"context_line":"            print(orphans_without_db)"},{"line_number":925,"context_line":"            self._update_usage_from_orphans(orphans_without_db, nodename)"},{"line_number":926,"context_line":""},{"line_number":927,"context_line":"        cn \u003d self.compute_nodes[nodename]"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_1e6d9b31","line":924,"range":{"start_line":924,"start_character":36,"end_line":924,"end_character":37},"in_reply_to":"9f560f44_8d941539","updated":"2020-08-24 09:18:33.000000000","message":"oh my bad","commit_id":"e11e560fee4d69956b0decbe2d9309e28044af5e"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"52d81833d28ff5184fecc0edb51fdf2bb5e1c6e0","unresolved":false,"context_lines":[{"line_number":906,"context_line":"        # hypervisor:"},{"line_number":907,"context_line":"        orphans \u003d self._find_orphaned_instances()"},{"line_number":908,"context_line":""},{"line_number":909,"context_line":"        if orphans:"},{"line_number":910,"context_line":"            # Track orphans with db records"},{"line_number":911,"context_line":"            orphans_with_db \u003d objects.InstanceList.get_by_filters("},{"line_number":912,"context_line":"                context, {\u0027uuid\u0027: [orphan[\u0027uuid\u0027] for orphan in orphans]},"},{"line_number":913,"context_line":"                expected_attrs\u003d[\u0027migration_context\u0027], use_slave\u003dTrue)"},{"line_number":914,"context_line":"            orphans_with_db_by_uuid \u003d self._update_usage_from_instances("},{"line_number":915,"context_line":"                context, orphans_with_db, nodename)"},{"line_number":916,"context_line":""},{"line_number":917,"context_line":"            # only considers memory usage in its calculations of orphans"},{"line_number":918,"context_line":"            # without db records"},{"line_number":919,"context_line":"            orphans_without_db \u003d [orphan for orphan in orphans"},{"line_number":920,"context_line":"                if orphan[\u0027uuid\u0027] not in orphans_with_db_by_uuid.keys()]"},{"line_number":921,"context_line":"            self._update_usage_from_orphans(orphans_without_db, nodename)"},{"line_number":922,"context_line":""},{"line_number":923,"context_line":"        cn \u003d self.compute_nodes[nodename]"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f560f44_069cf167","line":920,"range":{"start_line":909,"start_character":0,"end_line":920,"end_character":72},"updated":"2020-08-27 14:11:22.000000000","message":"So what you\u0027re saying is:\n\n    1.   Give me all VMs on the host.\n    2.a. For each VM with an Instance record, call \u0027_update_usage_from_instances\u0027\n    2.b. For each VM without an Instance record, use the value returned\n         by \u0027self.driver.get_per_instance_usage\u0027\n\nWhat would cause the second case? Non-nova instances or just deleted instances that haven\u0027t been cleaned up?\n\nI feel like we need different terms to talk about the things in 2.a. and the things in 2.b., but I haven\u0027t thought of a good name yet /o\\","commit_id":"4e998e6d8fff8b7c65159bd3cf40cab48e4a25be"},{"author":{"_account_id":23598,"name":"Zhong Luyao","email":"luyao.zhong@intel.com","username":"ZhongLuyao"},"change_message_id":"b14113b8552ac076598c1005811c46a7c955b686","unresolved":false,"context_lines":[{"line_number":906,"context_line":"        # hypervisor:"},{"line_number":907,"context_line":"        orphans \u003d self._find_orphaned_instances()"},{"line_number":908,"context_line":""},{"line_number":909,"context_line":"        if orphans:"},{"line_number":910,"context_line":"            # Track orphans with db records"},{"line_number":911,"context_line":"            orphans_with_db \u003d objects.InstanceList.get_by_filters("},{"line_number":912,"context_line":"                context, {\u0027uuid\u0027: [orphan[\u0027uuid\u0027] for orphan in orphans]},"},{"line_number":913,"context_line":"                expected_attrs\u003d[\u0027migration_context\u0027], use_slave\u003dTrue)"},{"line_number":914,"context_line":"            orphans_with_db_by_uuid \u003d self._update_usage_from_instances("},{"line_number":915,"context_line":"                context, orphans_with_db, nodename)"},{"line_number":916,"context_line":""},{"line_number":917,"context_line":"            # only considers memory usage in its calculations of orphans"},{"line_number":918,"context_line":"            # without db records"},{"line_number":919,"context_line":"            orphans_without_db \u003d [orphan for orphan in orphans"},{"line_number":920,"context_line":"                if orphan[\u0027uuid\u0027] not in orphans_with_db_by_uuid.keys()]"},{"line_number":921,"context_line":"            self._update_usage_from_orphans(orphans_without_db, nodename)"},{"line_number":922,"context_line":""},{"line_number":923,"context_line":"        cn \u003d self.compute_nodes[nodename]"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f560f44_e601f008","line":920,"range":{"start_line":909,"start_character":0,"end_line":920,"end_character":72},"in_reply_to":"9f560f44_069cf167","updated":"2020-08-28 09:01:57.000000000","message":"Second case  \u003d first case + admin deleting database records.\n\nIn previous code, it says orphans are \"exist on the hypervisor, but are not in the DB\".\n\nSo could we name the second case as \u0027orphans\u0027 still, and for first case, we could call it \u0027running_deleted_instances\u0027? since it\u0027s similar to https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L9862","commit_id":"4e998e6d8fff8b7c65159bd3cf40cab48e4a25be"},{"author":{"_account_id":23598,"name":"Zhong Luyao","email":"luyao.zhong@intel.com","username":"ZhongLuyao"},"change_message_id":"3f51820f7beec959a891b1789606d530deda5882","unresolved":false,"context_lines":[{"line_number":906,"context_line":"        # hypervisor:"},{"line_number":907,"context_line":"        orphans \u003d self._find_orphaned_instances()"},{"line_number":908,"context_line":""},{"line_number":909,"context_line":"        if orphans:"},{"line_number":910,"context_line":"            # Track orphans with db records"},{"line_number":911,"context_line":"            orphans_with_db \u003d objects.InstanceList.get_by_filters("},{"line_number":912,"context_line":"                context, {\u0027uuid\u0027: [orphan[\u0027uuid\u0027] for orphan in orphans]},"},{"line_number":913,"context_line":"                expected_attrs\u003d[\u0027migration_context\u0027], use_slave\u003dTrue)"},{"line_number":914,"context_line":"            orphans_with_db_by_uuid \u003d self._update_usage_from_instances("},{"line_number":915,"context_line":"                context, orphans_with_db, nodename)"},{"line_number":916,"context_line":""},{"line_number":917,"context_line":"            # only considers memory usage in its calculations of orphans"},{"line_number":918,"context_line":"            # without db records"},{"line_number":919,"context_line":"            orphans_without_db \u003d [orphan for orphan in orphans"},{"line_number":920,"context_line":"                if orphan[\u0027uuid\u0027] not in orphans_with_db_by_uuid.keys()]"},{"line_number":921,"context_line":"            self._update_usage_from_orphans(orphans_without_db, nodename)"},{"line_number":922,"context_line":""},{"line_number":923,"context_line":"        cn \u003d self.compute_nodes[nodename]"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f560f44_96593d90","line":920,"range":{"start_line":909,"start_character":0,"end_line":920,"end_character":72},"in_reply_to":"9f560f44_e601f008","updated":"2020-08-28 12:56:26.000000000","message":"in patch v7, I have not change the name yet, if you think \u0027orphans\u0027 and \u0027running_deleted_instances\u0027 are ok, or you come up with better name, I\u0027ll update in next version.","commit_id":"4e998e6d8fff8b7c65159bd3cf40cab48e4a25be"},{"author":{"_account_id":23598,"name":"Zhong Luyao","email":"luyao.zhong@intel.com","username":"ZhongLuyao"},"change_message_id":"d4febdbaca561e81b87414c51d40371fe0991a47","unresolved":false,"context_lines":[{"line_number":921,"context_line":"            orphans_with_db \u003d objects.InstanceList.get_by_filters("},{"line_number":922,"context_line":"                context, {\u0027uuid\u0027: [orphan[\u0027uuid\u0027] for orphan in orphans]},"},{"line_number":923,"context_line":"                expected_attrs\u003d[\u0027migration_context\u0027], use_slave\u003dTrue)"},{"line_number":924,"context_line":"            orphans_with_db_by_uuid \u003d self._update_usage_from_instances("},{"line_number":925,"context_line":"                context, orphans_with_db, nodename)"},{"line_number":926,"context_line":"            instance_by_uuid.update(orphans_with_db_by_uuid)"},{"line_number":927,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9f560f44_ae84afd4","line":924,"range":{"start_line":924,"start_character":43,"end_line":924,"end_character":71},"updated":"2020-09-02 01:53:27.000000000","message":"Oh no, I found this function clear self.tracked_instances at the beginning.","commit_id":"7b1d4c5030fa242817010f13127a21205e6d4be5"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"e792426aad7088cdd2042c6884317c27a5049242","unresolved":false,"context_lines":[{"line_number":917,"context_line":"        orphans \u003d self._find_orphaned_instances()"},{"line_number":918,"context_line":""},{"line_number":919,"context_line":"        if orphans:"},{"line_number":920,"context_line":"            # Track orphans with db records"},{"line_number":921,"context_line":"            orphans_with_db \u003d objects.InstanceList.get_by_filters("},{"line_number":922,"context_line":"                context, {\u0027uuid\u0027: [orphan[\u0027uuid\u0027] for orphan in orphans]},"},{"line_number":923,"context_line":"                expected_attrs\u003d[\u0027migration_context\u0027], use_slave\u003dTrue)"},{"line_number":924,"context_line":"            orphans_with_db_by_uuid \u003d self._update_usage_from_instances("},{"line_number":925,"context_line":"                context, orphans_with_db, nodename)"},{"line_number":926,"context_line":"            instance_by_uuid.update(orphans_with_db_by_uuid)"},{"line_number":927,"context_line":""},{"line_number":928,"context_line":"            # only considers memory usage in its calculations of orphans"},{"line_number":929,"context_line":"            # without db records"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f560f44_934db8c6","line":926,"range":{"start_line":920,"start_character":12,"end_line":926,"end_character":60},"updated":"2020-08-31 05:49:06.000000000","message":"If we get the instances with cleanup\u003dfalse at line 889, then we get the same result with those few lines, is it more easier?","commit_id":"7b1d4c5030fa242817010f13127a21205e6d4be5"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"a7a11e0b5dcff082737fd87c663d4374971a8f81","unresolved":false,"context_lines":[{"line_number":917,"context_line":"        orphans \u003d self._find_orphaned_instances()"},{"line_number":918,"context_line":""},{"line_number":919,"context_line":"        if orphans:"},{"line_number":920,"context_line":"            # Track orphans with db records"},{"line_number":921,"context_line":"            orphans_with_db \u003d objects.InstanceList.get_by_filters("},{"line_number":922,"context_line":"                context, {\u0027uuid\u0027: [orphan[\u0027uuid\u0027] for orphan in orphans]},"},{"line_number":923,"context_line":"                expected_attrs\u003d[\u0027migration_context\u0027], use_slave\u003dTrue)"},{"line_number":924,"context_line":"            orphans_with_db_by_uuid \u003d self._update_usage_from_instances("},{"line_number":925,"context_line":"                context, orphans_with_db, nodename)"},{"line_number":926,"context_line":"            instance_by_uuid.update(orphans_with_db_by_uuid)"},{"line_number":927,"context_line":""},{"line_number":928,"context_line":"            # only considers memory usage in its calculations of orphans"},{"line_number":929,"context_line":"            # without db records"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f560f44_165876f8","line":926,"range":{"start_line":920,"start_character":12,"end_line":926,"end_character":60},"in_reply_to":"9f560f44_16ca36a0","updated":"2020-08-31 07:17:26.000000000","message":"\u003e I prefer to use https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L9887\n\n\nsorry, I mean to use this method https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L638\n\n\n \u003e instead of building another logic to do the same thing. Then we can\n \u003e keep the periodic task `_cleanup_running_deleted_instance` and RT\n \u003e using the same way to track those running deleted instances.\n \u003e \n \u003e Discussed with luyao, luyao prefers to use the \u0027_find_orphaned_instances\u0027\n \u003e that avoid doing another aournd loop of the instances on driver.\n \u003e \n \u003e I\u0027m ok both, but at least we should rename the \u0027orphans_with_db\u0027 to\n \u003e running_deleted_instance. We shouldn\u0027t create another term, that is\n \u003e confuse really.","commit_id":"7b1d4c5030fa242817010f13127a21205e6d4be5"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"c432f2f2569e2dffa10189273531baa7e0f12f1d","unresolved":false,"context_lines":[{"line_number":917,"context_line":"        orphans \u003d self._find_orphaned_instances()"},{"line_number":918,"context_line":""},{"line_number":919,"context_line":"        if orphans:"},{"line_number":920,"context_line":"            # Track orphans with db records"},{"line_number":921,"context_line":"            orphans_with_db \u003d objects.InstanceList.get_by_filters("},{"line_number":922,"context_line":"                context, {\u0027uuid\u0027: [orphan[\u0027uuid\u0027] for orphan in orphans]},"},{"line_number":923,"context_line":"                expected_attrs\u003d[\u0027migration_context\u0027], use_slave\u003dTrue)"},{"line_number":924,"context_line":"            orphans_with_db_by_uuid \u003d self._update_usage_from_instances("},{"line_number":925,"context_line":"                context, orphans_with_db, nodename)"},{"line_number":926,"context_line":"            instance_by_uuid.update(orphans_with_db_by_uuid)"},{"line_number":927,"context_line":""},{"line_number":928,"context_line":"            # only considers memory usage in its calculations of orphans"},{"line_number":929,"context_line":"            # without db records"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f560f44_16ca36a0","line":926,"range":{"start_line":920,"start_character":12,"end_line":926,"end_character":60},"in_reply_to":"9f560f44_335aec4f","updated":"2020-08-31 07:13:09.000000000","message":"I prefer to use https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L9887 instead of building another logic to do the same thing. Then we can keep the periodic task `_cleanup_running_deleted_instance` and RT using the same way to track those running deleted instances.\n \nDiscussed with luyao, luyao prefers to use the \u0027_find_orphaned_instances\u0027 that avoid doing another aournd loop of the instances on driver.\n\nI\u0027m ok both, but at least we should rename the \u0027orphans_with_db\u0027 to running_deleted_instance. We shouldn\u0027t create another term, that is confuse really.","commit_id":"7b1d4c5030fa242817010f13127a21205e6d4be5"},{"author":{"_account_id":23598,"name":"Zhong Luyao","email":"luyao.zhong@intel.com","username":"ZhongLuyao"},"change_message_id":"c92ba3457b20c30b57e47ecbaf058a0af0f83035","unresolved":false,"context_lines":[{"line_number":917,"context_line":"        orphans \u003d self._find_orphaned_instances()"},{"line_number":918,"context_line":""},{"line_number":919,"context_line":"        if orphans:"},{"line_number":920,"context_line":"            # Track orphans with db records"},{"line_number":921,"context_line":"            orphans_with_db \u003d objects.InstanceList.get_by_filters("},{"line_number":922,"context_line":"                context, {\u0027uuid\u0027: [orphan[\u0027uuid\u0027] for orphan in orphans]},"},{"line_number":923,"context_line":"                expected_attrs\u003d[\u0027migration_context\u0027], use_slave\u003dTrue)"},{"line_number":924,"context_line":"            orphans_with_db_by_uuid \u003d self._update_usage_from_instances("},{"line_number":925,"context_line":"                context, orphans_with_db, nodename)"},{"line_number":926,"context_line":"            instance_by_uuid.update(orphans_with_db_by_uuid)"},{"line_number":927,"context_line":""},{"line_number":928,"context_line":"            # only considers memory usage in its calculations of orphans"},{"line_number":929,"context_line":"            # without db records"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f560f44_335aec4f","line":926,"range":{"start_line":920,"start_character":12,"end_line":926,"end_character":60},"in_reply_to":"9f560f44_738d84d2","updated":"2020-08-31 06:25:32.000000000","message":"There is a config option \"running_deleted_instance_timeout\" , https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L9891, but here we don\u0027t has this timeout limit.","commit_id":"7b1d4c5030fa242817010f13127a21205e6d4be5"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"00f494a80db069aadd6a857f2696ec9fd1304c34","unresolved":false,"context_lines":[{"line_number":917,"context_line":"        orphans \u003d self._find_orphaned_instances()"},{"line_number":918,"context_line":""},{"line_number":919,"context_line":"        if orphans:"},{"line_number":920,"context_line":"            # Track orphans with db records"},{"line_number":921,"context_line":"            orphans_with_db \u003d objects.InstanceList.get_by_filters("},{"line_number":922,"context_line":"                context, {\u0027uuid\u0027: [orphan[\u0027uuid\u0027] for orphan in orphans]},"},{"line_number":923,"context_line":"                expected_attrs\u003d[\u0027migration_context\u0027], use_slave\u003dTrue)"},{"line_number":924,"context_line":"            orphans_with_db_by_uuid \u003d self._update_usage_from_instances("},{"line_number":925,"context_line":"                context, orphans_with_db, nodename)"},{"line_number":926,"context_line":"            instance_by_uuid.update(orphans_with_db_by_uuid)"},{"line_number":927,"context_line":""},{"line_number":928,"context_line":"            # only considers memory usage in its calculations of orphans"},{"line_number":929,"context_line":"            # without db records"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f560f44_738d84d2","line":926,"range":{"start_line":920,"start_character":12,"end_line":926,"end_character":60},"in_reply_to":"9f560f44_934db8c6","updated":"2020-08-31 06:03:53.000000000","message":"I think I get answer for my own. They are different. This is about the instance still running but DB entry mark as deleted. instance.cleanup\u003dfalse is the case instance isn\u0027t running.\n\nSo what we are tracking here is the case instance is still running.\n\nBut can we use this method https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L9832 to get the running deleted method directly, instead of using a different way to get those instances compare to the periodic task \u0027_cleanup_running_deleted_instances\u0027","commit_id":"7b1d4c5030fa242817010f13127a21205e6d4be5"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"5d002042bddde4c5f1b12b80dd0a1ca0d3de6df5","unresolved":false,"context_lines":[{"line_number":11060,"context_line":"                    return None"},{"line_number":11061,"context_line":""},{"line_number":11062,"context_line":"    def get_per_instance_usage(self):"},{"line_number":11063,"context_line":"        \"\"\"Get usage info about each active instance.\"\"\""},{"line_number":11064,"context_line":"        usage \u003d {}"},{"line_number":11065,"context_line":"        for guest in self._host.list_guests(only_running\u003dFalse):"},{"line_number":11066,"context_line":"            state, max_mem, mem, num_cpu, cpu_time \u003d guest._get_domain_info()"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_6da9c17a","line":11063,"updated":"2020-08-20 10:53:38.000000000","message":"This is new. Why\u0027s it necessary? I don\u0027t see any notes in the commit message or this docstring about it","commit_id":"e11e560fee4d69956b0decbe2d9309e28044af5e"},{"author":{"_account_id":23598,"name":"Zhong Luyao","email":"luyao.zhong@intel.com","username":"ZhongLuyao"},"change_message_id":"820e494cddd657f76aa0312cce6ae5c40a656b79","unresolved":false,"context_lines":[{"line_number":11060,"context_line":"                    return None"},{"line_number":11061,"context_line":""},{"line_number":11062,"context_line":"    def get_per_instance_usage(self):"},{"line_number":11063,"context_line":"        \"\"\"Get usage info about each active instance.\"\"\""},{"line_number":11064,"context_line":"        usage \u003d {}"},{"line_number":11065,"context_line":"        for guest in self._host.list_guests(only_running\u003dFalse):"},{"line_number":11066,"context_line":"            state, max_mem, mem, num_cpu, cpu_time \u003d guest._get_domain_info()"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_fe526766","line":11063,"in_reply_to":"9f560f44_6da9c17a","updated":"2020-08-24 09:18:33.000000000","message":"Done","commit_id":"e11e560fee4d69956b0decbe2d9309e28044af5e"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"52d81833d28ff5184fecc0edb51fdf2bb5e1c6e0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"9f560f44_86e481e1","line":11072,"updated":"2020-08-27 14:11:22.000000000","message":"Ah, okay, so previously \u0027_update_usage_from_orphans\u0027 wasn\u0027t returning anything because this wasn\u0027t implemented in libvirt.\n\nThis needs unit tests though","commit_id":"4e998e6d8fff8b7c65159bd3cf40cab48e4a25be"},{"author":{"_account_id":23598,"name":"Zhong Luyao","email":"luyao.zhong@intel.com","username":"ZhongLuyao"},"change_message_id":"3f51820f7beec959a891b1789606d530deda5882","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"9f560f44_16908ded","line":11072,"in_reply_to":"9f560f44_86e481e1","updated":"2020-08-28 12:56:26.000000000","message":"Done","commit_id":"4e998e6d8fff8b7c65159bd3cf40cab48e4a25be"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"e7bae26d9bc11b9b8eaad9564bb18dc6e0192c27","unresolved":false,"context_lines":[{"line_number":11209,"context_line":"                              {\u0027uri\u0027: self._host._uri, \u0027error\u0027: ex})"},{"line_number":11210,"context_line":"                    return None"},{"line_number":11211,"context_line":""},{"line_number":11212,"context_line":"    def get_per_instance_usage(self):"},{"line_number":11213,"context_line":"        \"\"\"Get usage info about each active instance.\"\"\""},{"line_number":11214,"context_line":"        usage \u003d {}"},{"line_number":11215,"context_line":"        for guest in self._host.list_guests(only_running\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f560f44_b6070aca","line":11212,"range":{"start_line":11212,"start_character":8,"end_line":11212,"end_character":37},"updated":"2020-08-31 07:21:38.000000000","message":"I didn\u0027t see hyperv implement this method. But hyperv implements the https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L647\n\nSo the concern is that may lead to the RT and _cleanup_running_deleted_instance have different behaviour...\n\nI\u0027m not familar with other virt dirvers, leave this to other reviewer.","commit_id":"7b1d4c5030fa242817010f13127a21205e6d4be5"}]}
