From: Witold Kręcicki Date: Sun, 8 Dec 2019 20:14:08 +0000 (+0100) Subject: pause and unpause netmgr in isc_nm_destroy to flush all events from worker queues X-Git-Tag: v9.15.7~20^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef2dff5c7a34b59630045fa9c72fd0e6e0a75bf8;p=thirdparty%2Fbind9.git pause and unpause netmgr in isc_nm_destroy to flush all events from worker queues --- diff --git a/lib/isc/netmgr/netmgr.c b/lib/isc/netmgr/netmgr.c index 636c919730d..0713aa42fcf 100644 --- a/lib/isc/netmgr/netmgr.c +++ b/lib/isc/netmgr/netmgr.c @@ -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