Sync can run as part of Neutron and as a standalone tool.
So when sync is triggered through Neutron, someone can
trigger another sync cycle using the standalone tool.
Similarly when sync is triggered by standalone tool, Neutron
can trigger another sync cycle. This can lead to unexpected
sync behaviour .This fix will allow only one sync cycle at a
time and the other cycle will be blocked till the first one is
complete.
Change-Id: I9ffd07bea38d806f92edc160480b5896d3393202
Closes-Bug:
1398190
from neutron.db import extraroute_db
from neutron.db import securitygroups_db
from neutron.i18n import _LE, _LI, _LW
+from neutron.openstack.common import lockutils
from neutron.openstack.common import log
from neutron.plugins.nuage.common import config
from neutron.plugins.nuage import nuagedb
self.context = ncontext.get_admin_context()
self.nuageclient = nuageclient
+ @lockutils.synchronized('synchronize', 'nuage-sync', external=True)
def synchronize(self, fipquota):
LOG.info(_LI("Starting the sync between Neutron and VSD"))
try: