summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArjun Baindur <xagent@gmail.com>2018-07-31 14:36:32 -0700
committerErik Olof Gunnar Andersson <eandersson@blizzard.com>2018-10-01 00:02:33 -0700
commit59c5c664654b88772a6309fbb319e446423317c0 (patch)
tree5ead563c9681feb59e455f1d08d1ade6e32dfcc6
parent4dda8632412f0d84aff0bdb331bc15f91085a66c (diff)
downloaddesignate-59c5c664654b88772a6309fbb319e446423317c0.tar.gz
Make update_status use synchronized_zone
There is a race condition when adding a new recordset to a zone and when central is processing the update_status from a previous recordset/zone operation. In the subsequent recordset operation, central fails to update the zone's action/status in DB to UPDATE/PENDING. It remains as NONE/ACTIVE, and worker error's out. Each operation retrieves a different copy in memory of the Zone object (when it calls self.storage.get_zone). As a result this does not update the obj_changes field for the zone object for the latter operation. Therefore the DB update doesn't update any values. update_status should be synchronized as it updates zone DB Change-Id: Ib4e0bc567ba8eb54c61c3921d165521bf2f12206 Closes-Bug: #1713875 (cherry picked from commit 12cd654b143e215dbe01cc2688a7d6e6cf3ce62f)
-rw-r--r--designate/central/service.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/designate/central/service.py b/designate/central/service.py
index e22ab966..a51f3c0c 100644
--- a/designate/central/service.py
+++ b/designate/central/service.py
@@ -2302,6 +2302,7 @@ class Service(service.RPCService, service.Service):
@notification('dns.domain.update')
@notification('dns.zone.update')
@transaction
+ @synchronized_zone()
def update_status(self, context, zone_id, status, serial):
"""
:param context: Security context information.