ThreadSanitizer: data race /home/ondrej/Projects/bind9/lib/dns/rbt.c:2258:15 in deletetreeflat
This might be unrelated to the dispatch@netmgr changes, but I don't recall seeing this. I reproduced the issue locally, just by running the system tests in the loop.
WARNING: ThreadSanitizer: data race (pid=1780187)
Write of size 8 at 0x7b1c00013d68 by thread T3:
#0 deletetreeflat /home/ondrej/Projects/bind9/lib/dns/rbt.c:2258:15 (libdns-9.17.18.so+0x1922e3)
#1 dns_rbt_destroy2 /home/ondrej/Projects/bind9/lib/dns/rbt.c:349:2 (libdns-9.17.18.so+0x191ff3)
#2 dns_rbt_destroy /home/ondrej/Projects/bind9/lib/dns/rbt.c:338:2 (libdns-9.17.18.so+0x191ef7)
#3 zt_destroy /home/ondrej/Projects/bind9/lib/dns/zt.c:228:2 (libdns-9.17.18.so+0x41e4a0)
#4 zt_flushanddetach /home/ondrej/Projects/bind9/lib/dns/zt.c:248:3 (libdns-9.17.18.so+0x41ca6c)
#5 dns_zt_flushanddetach /home/ondrej/Projects/bind9/lib/dns/zt.c:254:2 (libdns-9.17.18.so+0x41c8fa)
#6 view_flushanddetach /home/ondrej/Projects/bind9/lib/dns/view.c:649:4 (libdns-9.17.18.so+0x36ce97)
#7 dns_view_detach /home/ondrej/Projects/bind9/lib/dns/view.c:697:2 (libdns-9.17.18.so+0x36d297)
#8 ns_client_endrequest /home/ondrej/Projects/bind9/lib/ns/client.c:195:3 (libns-9.17.18.so+0x159fa)
#9 ns__client_reset_cb /home/ondrej/Projects/bind9/lib/ns/client.c:1561:2 (libns-9.17.18.so+0x14f5d)
#10 nmhandle_detach_cb /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1864:3 (libisc-9.17.18.so+0x2c1cd)
#11 isc__nmhandle_detach /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1820:3 (libisc-9.17.18.so+0x2520f)
#12 prefetch_done /home/ondrej/Projects/bind9/lib/ns/query.c:2523:2 (libns-9.17.18.so+0x524a4)
#13 task_run /home/ondrej/Projects/bind9/lib/isc/task.c:827:5 (libisc-9.17.18.so+0xafd6c)
#14 isc_task_run /home/ondrej/Projects/bind9/lib/isc/task.c:907:10 (libisc-9.17.18.so+0xaf645)
#15 isc__nm_async_task /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:834:11 (libisc-9.17.18.so+0x32f3e)
#16 process_netievent /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:913:3 (libisc-9.17.18.so+0x2797a)
#17 process_queue /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1007:16 (libisc-9.17.18.so+0x32dda)
#18 process_all_queues /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:753:25 (libisc-9.17.18.so+0x32bff)
#19 async_cb /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:782:6 (libisc-9.17.18.so+0x215a2)
#20 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5 (libuv.so.1+0x12403)
#21 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/epoll.c:374:11 (libuv.so.1+0x309bc)
#22 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:389:5 (libuv.so.1+0x12d2a)
#23 nm_thread /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:688:11 (libisc-9.17.18.so+0x21662)
#24 isc__trampoline_run /home/ondrej/Projects/bind9/lib/isc/trampoline.c:185:11 (libisc-9.17.18.so+0xbe689)
Previous read of size 8 at 0x7b1c00013d68 by thread T6 (mutexes: write M780947598420187352, write M1150242458626439272, read M1150523624365490200):
#0 dns_rbt_findnode /home/ondrej/Projects/bind9/lib/dns/rbt.c:1071:15 (libdns-9.17.18.so+0x196cc2)
#1 dns_rbt_findname /home/ondrej/Projects/bind9/lib/dns/rbt.c:1326:11 (libdns-9.17.18.so+0x198a3c)
#2 dns_zt_find /home/ondrej/Projects/bind9/lib/dns/zt.c:172:11 (libdns-9.17.18.so+0x41c6b9)
#3 dns_view_find /home/ondrej/Projects/bind9/lib/dns/view.c:1056:12 (libdns-9.17.18.so+0x37295b)
#4 dbfind_name /home/ondrej/Projects/bind9/lib/dns/adb.c:3674:11 (libdns-9.17.18.so+0x458b9)
#5 dns_adb_createfind /home/ondrej/Projects/bind9/lib/dns/adb.c:3043:12 (libdns-9.17.18.so+0x42561)
#6 findname /home/ondrej/Projects/bind9/lib/dns/resolver.c:3274:11 (libdns-9.17.18.so+0x2dac56)
#7 fctx_getaddresses /home/ondrej/Projects/bind9/lib/dns/resolver.c:3609:3 (libdns-9.17.18.so+0x2d6afb)
#8 fctx_try /home/ondrej/Projects/bind9/lib/dns/resolver.c:3999:12 (libdns-9.17.18.so+0x2ce520)
#9 fctx_start /home/ondrej/Projects/bind9/lib/dns/resolver.c:4494:2 (libdns-9.17.18.so+0x2c48ed)
#10 task_run /home/ondrej/Projects/bind9/lib/isc/task.c:827:5 (libisc-9.17.18.so+0xafd6c)
#11 isc_task_run /home/ondrej/Projects/bind9/lib/isc/task.c:907:10 (libisc-9.17.18.so+0xaf645)
#12 isc__nm_async_task /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:834:11 (libisc-9.17.18.so+0x32f3e)
#13 process_netievent /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:913:3 (libisc-9.17.18.so+0x2797a)
#14 process_queue /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1007:16 (libisc-9.17.18.so+0x32dda)
#15 process_all_queues /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:753:25 (libisc-9.17.18.so+0x32bff)
#16 async_cb /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:782:6 (libisc-9.17.18.so+0x215a2)
#17 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5 (libuv.so.1+0x12403)
#18 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/epoll.c:374:11 (libuv.so.1+0x309bc)
#19 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:389:5 (libuv.so.1+0x12d2a)
#20 nm_thread /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:688:11 (libisc-9.17.18.so+0x21662)
#21 isc__trampoline_run /home/ondrej/Projects/bind9/lib/isc/trampoline.c:185:11 (libisc-9.17.18.so+0xbe689)
Location is heap block of size 107 at 0x7b1c00013d30 allocated by thread T1:
#0 malloc <null> (named+0x45e47d)
#1 mallocx /home/ondrej/Projects/bind9/lib/isc/./jemalloc_shim.h:30:10 (libisc-9.17.18.so+0x8f46e)
#2 mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:340:8 (libisc-9.17.18.so+0x87c0e)
#3 isc__mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:753:8 (libisc-9.17.18.so+0x87ab7)
#4 create_node /home/ondrej/Projects/bind9/lib/dns/rbt.c:1553:9 (libdns-9.17.18.so+0x194299)