While it is true that populate_missing_availability_zone does not check for deleted instances; I don't see how it can go into infinite loop unless there is no CONF.default_availability_zone set (https://github.com/openstack/nova/blob/722d5b477219f0a2435a9f4ad4d54c61b83219f1/nova/availability_zones.py#L99) which is the last resort; meaning CONF.default_availability_zone is set to None, which by default is "nova".
Probably its the situation where the instance was deleted before being scheduled to a compute node in which case it could hit https://github.com/openstack/nova/blob/722d5b477219f0a2435a9f4ad4d54c61b83219f1/nova/availability_zones.py#L168. Could you confirm if it is indeed this i.e instance.host was NULL?
While it is true that populate_ missing_ availability_ zone does not check for deleted instances; I don't see how it can go into infinite loop unless there is no CONF.default_ availability_ zone set (https:/ /github. com/openstack/ nova/blob/ 722d5b477219f0a 2435a9f4ad4d54c 61b83219f1/ nova/availabili ty_zones. py#L99) which is the last resort; meaning CONF.default_ availability_ zone is set to None, which by default is "nova".
Probably its the situation where the instance was deleted before being scheduled to a compute node in which case it could hit https:/ /github. com/openstack/ nova/blob/ 722d5b477219f0a 2435a9f4ad4d54c 61b83219f1/ nova/availabili ty_zones. py#L168. Could you confirm if it is indeed this i.e instance.host was NULL?