]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pause and unpause netmgr in isc_nm_destroy to flush all events from worker queues
authorWitold Kręcicki <wpk@isc.org>
Sun, 8 Dec 2019 20:14:08 +0000 (21:14 +0100)
committerWitold Kręcicki <wpk@isc.org>
Mon, 9 Dec 2019 20:44:04 +0000 (21:44 +0100)
lib/isc/netmgr/netmgr.c

index 636c919730df1ba197d361a98d2fc181c38065a0..0713aa42fcf7c96d446c7d8368500d96a00650a0 100644 (file)
@@ -337,6 +337,14 @@ isc_nm_destroy(isc_nm_t **mgr0) {
         * Wait for the manager to be dereferenced elsewhere.
         */
        while (isc_refcount_current(&mgr->references) > 1) {
+               /*
+                * Sometimes libuv gets stuck, pausing and unpausing
+                * netmgr goes over all events in async queue for all
+                * the workers, and since it's done only on shutdown it
+                * doesn't cost us anything.
+                */
+               isc_nm_pause(mgr);
+               isc_nm_resume(mgr);
 #ifdef WIN32
                _sleep(1000);
 #else