Avoid race between activating vif and pod deletion
Closes-Bug:
# License for the specific language governing permissions and limitations
# under the License.
+from neutronclient.common import exceptions as n_exc
from oslo_cache import core as cache
from oslo_config import cfg as oslo_cfg
from oslo_log import log as logging
@@ -134,8 +135,12 @@ class VIFHandler(k8s_base.ResourceEventHandler):
if vif.plugin == constants.KURYR_VIF_TYPE_SRIOV:
driver_utils.update_port_pci_info(pod, vif)
if not vif.active:
+ try:
self._drv_vif_pool.activate_vif(pod, vif)
changed = True
+ except n_exc.PortNotFoundClient:
+ LOG.debug("Port not found, possibly already "
+ "deleted. No need to activate it")
finally:
if changed:
try:
