Merge branch '3520-rndc-shutdown-hang-v9_18' into 'v9_18'

prevent a possible shutdown hang in rndc

See merge request isc-projects/bind9!6764
This commit is contained in:
Evan Hunt 2022-09-12 21:02:36 +00:00
commit 4252ee5c5f

View file

@ -388,8 +388,8 @@ rndc_recvdone(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
REQUIRE(recvdone_handle == handle);
isc_nmhandle_detach(&recvdone_handle);
if (atomic_load_acquire(&sends) == 0 &&
atomic_fetch_sub_release(&recvs, 1) == 1)
if (atomic_fetch_sub_release(&recvs, 1) == 1 &&
atomic_load_acquire(&sends) == 0)
{
shuttingdown = true;
isc_app_shutdown();