diff --git a/CHANGES b/CHANGES index 32ebaec2f9..ddc71de48f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +6337. [bug] Nsupdate could assert while shutting down. [GL #4529] + 6336. [func] Expose the zones with the 'first refresh' flag set in statistics channel's "Incoming Zone Transfers" section to indicate the zones that are not yet fully ready, and diff --git a/lib/dns/request.c b/lib/dns/request.c index 14a96058c2..400cfe04f5 100644 --- a/lib/dns/request.c +++ b/lib/dns/request.c @@ -190,15 +190,20 @@ requests_shutdown(void *arg) { void dns_requestmgr_shutdown(dns_requestmgr_t *requestmgr) { + bool first; REQUIRE(VALID_REQUESTMGR(requestmgr)); req_log(ISC_LOG_DEBUG(3), "%s: %p", __func__, requestmgr); rcu_read_lock(); - INSIST(atomic_compare_exchange_strong(&requestmgr->shuttingdown, - &(bool){ false }, true)); + first = atomic_compare_exchange_strong(&requestmgr->shuttingdown, + &(bool){ false }, true); rcu_read_unlock(); + if (!first) { + return; + } + /* * Wait until all dns_request_create{raw}() are finished, so * there will be no new requests added to the lists.