That commit from arosen is from 2013, and this is fixed I think since then:
"""
This problem usually manifests it's self when nova-compute
calls to neutron to create a port and the request times out (though
the port is actually created in neutron). When this occurs the instance
can be rescheduled on another compute node which it will call out to
neutron again to create a port. In this case two ports will show
up in the network_cache table (since they have the same instance_id) though
only one port is attached to the instance.
"""
That commit from arosen is from 2013, and this is fixed I think since then:
"""
This problem usually manifests it's self when nova-compute
calls to neutron to create a port and the request times out (though
the port is actually created in neutron). When this occurs the instance
can be rescheduled on another compute node which it will call out to
neutron again to create a port. In this case two ports will show
up in the network_cache table (since they have the same instance_id) though
only one port is attached to the instance.
"""
via this change:
https:/ /review. openstack. org/#/c/ 520248/
So nova will cleanup ports created during a failed build prior to rescheduling.
So I think we should add a force_refresh flag to the _heal_instance_ info_cache flow so that we refresh from neutron rather than the nova db.