Merge "Avoid race between activating vif and pod deletion"
This commit is contained in:
commit
08f4e2ca30
@ -13,6 +13,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from neutronclient.common import exceptions as n_exc
|
||||||
from oslo_cache import core as cache
|
from oslo_cache import core as cache
|
||||||
from oslo_config import cfg as oslo_cfg
|
from oslo_config import cfg as oslo_cfg
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
@ -134,8 +135,12 @@ class VIFHandler(k8s_base.ResourceEventHandler):
|
|||||||
if vif.plugin == constants.KURYR_VIF_TYPE_SRIOV:
|
if vif.plugin == constants.KURYR_VIF_TYPE_SRIOV:
|
||||||
driver_utils.update_port_pci_info(pod, vif)
|
driver_utils.update_port_pci_info(pod, vif)
|
||||||
if not vif.active:
|
if not vif.active:
|
||||||
self._drv_vif_pool.activate_vif(pod, vif)
|
try:
|
||||||
changed = True
|
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:
|
finally:
|
||||||
if changed:
|
if changed:
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user