From e19764972e144c6e726d20dbeca45ac3eda43700 Mon Sep 17 00:00:00 2001 From: Thomas Bachman Date: Tue, 8 Jan 2019 01:58:52 +0000 Subject: [PATCH] Fix DBDuplicateEntry in HA configurations With multiple neutron-server processes and controllers, there is a race-condition for creation of certain resources on startup. This patch adds the retry decorator, which will retry DBDuplicateEntry exceptions, and ignore creation if the resource has been created already. Change-Id: I58d2737e585cee13ae1a5f37ec6e567ccc06339f --- .../neutron/plugins/ml2plus/drivers/apic_aim/mechanism_driver.py | 1 + 1 file changed, 1 insertion(+) diff --git a/gbpservice/neutron/plugins/ml2plus/drivers/apic_aim/mechanism_driver.py b/gbpservice/neutron/plugins/ml2plus/drivers/apic_aim/mechanism_driver.py index 971f6da4d..7da0db795 100644 --- a/gbpservice/neutron/plugins/ml2plus/drivers/apic_aim/mechanism_driver.py +++ b/gbpservice/neutron/plugins/ml2plus/drivers/apic_aim/mechanism_driver.py @@ -292,6 +292,7 @@ class ApicMechanismDriver(api_plus.MechanismDriver, raise exceptions.ExhaustedApicRouterIdPool( pool=self.apic_router_id_pool) + @db_api.retry_db_errors def _ensure_static_resources(self): session = db_api.get_writer_session() aim_ctx = aim_context.AimContext(session)