From 18d662f4d2cddd78b1cb28055bef8b9235a3fe15 Mon Sep 17 00:00:00 2001 From: Artem Boldariev Date: Tue, 16 May 2023 17:33:42 +0300 Subject: [PATCH] Pass the right worker into isc__nm_async_sockstop() The intention behind 'isc__nmsocket_stop()' was that the function sends notifications on every worker thread, making them synchronise on the barrier, then the initiating thread waits on it, too. This way we ensure than no other operation will start when we shutting down the listener. However, it seems that due to mistake we have been passing the wrong worker pointer into isc__nm_async_sockstop() from within the context of an worker thread which has initiated shutting down. While effectively we have not been using the pointer in this case, it could cause maintenance issues later. This commit fixes that. --- lib/isc/netmgr/netmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/isc/netmgr/netmgr.c b/lib/isc/netmgr/netmgr.c index 74d326aa0a..00a7945edb 100644 --- a/lib/isc/netmgr/netmgr.c +++ b/lib/isc/netmgr/netmgr.c @@ -2756,7 +2756,7 @@ isc__nmsocket_stop(isc_nmsocket_t *listener) { } if (isc__nm_in_netthread()) { - isc__nm_async_sockstop(&listener->mgr->workers[0], + isc__nm_async_sockstop(&listener->mgr->workers[isc_nm_tid()], (isc__netievent_t *)&ievent); } }