]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
zone update: warn if blocked by ctl zone transaction
authorLibor Peltan <libor.peltan@nic.cz>
Thu, 24 Oct 2019 15:31:18 +0000 (17:31 +0200)
committerDaniel Salzman <daniel.salzman@nic.cz>
Fri, 25 Oct 2019 12:28:06 +0000 (14:28 +0200)
src/knot/updates/zone-update.c

index 397af8be572c865f94f0e6e758e0a467325fa0cb..eadc6aecdebc3090c063721eab154d79aa9588eb 100644 (file)
@@ -127,6 +127,10 @@ static int init_base(zone_update_t *update, zone_t *zone, zone_contents_t *old_c
                return KNOT_ENOMEM;
        }
 
+       if (zone->control_update != NULL && zone->control_update != update) {
+               log_zone_warning(zone->name, "blocked zone update due to open control transaction");
+       }
+
        knot_sem_wait(&zone->cow_lock);
        update->a_ctx->cow_mutex = &zone->cow_lock;
 
@@ -230,6 +234,11 @@ int zone_update_from_contents(zone_update_t *update, zone_t *zone_without_conten
                return KNOT_ENOMEM;
        }
 
+       if (zone_without_contents->control_update != NULL) {
+               log_zone_warning(zone_without_contents->name,
+                                "blocked zone update due to open control transaction");
+       }
+
        knot_sem_wait(&update->zone->cow_lock);
        update->a_ctx->cow_mutex = &update->zone->cow_lock;