The workaround with the 1 second sleep seems to suggest there is a race window where the instance is not mapped to a cell yet but the build request is also gone, which shouldn't happen as we create the instance in the cell before deleting the build request:
So while it's possible for the instance to be created in the cell database but the instance mapping record isn't yet updated, we account for that when looking up the instance here:
The workaround with the 1 second sleep seems to suggest there is a race window where the instance is not mapped to a cell yet but the build request is also gone, which shouldn't happen as we create the instance in the cell before deleting the build request:
https:/ /github. com/openstack/ nova/blob/ 15.0.0/ nova/conductor/ manager. py#L914
https:/ /github. com/openstack/ nova/blob/ 15.0.0/ nova/conductor/ manager. py#L937
So while it's possible for the instance to be created in the cell database but the instance mapping record isn't yet updated, we account for that when looking up the instance here:
https:/ /github. com/openstack/ nova/blob/ 15.0.0/ nova/compute/ api.py# L2276
and here:
https:/ /github. com/openstack/ nova/blob/ 15.0.0/ nova/compute/ api.py# L2289