From b55e8a959f346220c56d23f340243aa8157dc1ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Fri, 22 Apr 2022 16:48:37 +0200 Subject: [PATCH] Allow attaching to dns_adb which is shutting down The dns__adb_attach() had an assertion failure that prevented to attach to dns_adb if the dns_adb was shutting down. There was a race between checking for .exiting in dns_adb_createfind and creating new_adbfind() - other thread could have set the .exiting to true between the check. Remove the assertion failure and allow attaching to dns_adb even while shutting down. The process of dns_adb shutting down would be noticed only a moments later when any other callback is called. --- lib/dns/adb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/dns/adb.c b/lib/dns/adb.c index edce5bf18c..dd311ee495 100644 --- a/lib/dns/adb.c +++ b/lib/dns/adb.c @@ -2169,7 +2169,6 @@ dns__adb_attach(dns_adb_t *adb, dns_adb_t **adbp, const char *func, REQUIRE(DNS_ADB_VALID(adb)); REQUIRE(adbp != NULL && *adbp == NULL); - REQUIRE(!atomic_load_acquire(&adb->exiting)); refs = isc_refcount_increment(&adb->references); #ifdef ADB_TRACE