Propagate retry exception in implicit subnet allocation
In concurrent execution cases a failure can occur in the Neutron IPAM component due to failure to obtaining a lock. In such cases the IPAM component raises a retry exception which should be not be eaten, but relayed as is so that the operation can be retried. This patch checks if the exception raised during a subnet allocation from a subnetpool fails due to a retry exception, and if so, raises it as is to facilitate a retry. Change-Id: I381cdf533b27d710f68903f0cfb516043b4607d6
This commit is contained in:
parent
16dca6514e
commit
4cb980661e
@ -24,6 +24,7 @@ from neutron_lib import constants as n_const
|
||||
from neutron_lib.db import model_base
|
||||
from neutron_lib import exceptions as n_exc
|
||||
from oslo_config import cfg
|
||||
from oslo_db import exception as oslo_db_excp
|
||||
from oslo_log import helpers as log
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
@ -618,11 +619,13 @@ class ImplicitResourceOperations(local_api.LocalAPI,
|
||||
subnets.append(subnet)
|
||||
break
|
||||
except Exception as e:
|
||||
if isinstance(e, oslo_db_excp.RetryRequest):
|
||||
raise e
|
||||
LOG.info(_LI("Allocating subnet from subnetpool %(sp)s "
|
||||
"failed. Allocation will be attempted "
|
||||
"from any other configured "
|
||||
"subnetpool(s). Exception: %(excp)s"),
|
||||
{'sp': pool['id'], 'excp': e})
|
||||
{'sp': pool['id'], 'excp': type(e)})
|
||||
last = e
|
||||
continue
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user