mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
pause and unpause netmgr in isc_nm_destroy to flush all events from worker queues
This commit is contained in:
@@ -337,6 +337,14 @@ isc_nm_destroy(isc_nm_t **mgr0) {
|
|||||||
* Wait for the manager to be dereferenced elsewhere.
|
* Wait for the manager to be dereferenced elsewhere.
|
||||||
*/
|
*/
|
||||||
while (isc_refcount_current(&mgr->references) > 1) {
|
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
|
#ifdef WIN32
|
||||||
_sleep(1000);
|
_sleep(1000);
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user