It appears that you can't change what you are polling for while connecting.
WARNING: ThreadSanitizer: data race Read of size 8 at 0x000000000001 by thread T1 (mutexes: write M1): #0 epoll_ctl #1 watch_fd lib/isc/unix/socket.c:704:8 #2 wakeup_socket lib/isc/unix/socket.c:897:11 #3 process_ctlfd lib/isc/unix/socket.c:3362:3 #4 (closed) process_fds lib/isc/unix/socket.c:3275:10 #5 (closed) netthread lib/isc/unix/socket.c:3516:10
Previous write of size 8 at 0x000000000001 by thread T2 (mutexes: write M2):
#0 connect <null>
#1 isc_socket_connect lib/isc/unix/socket.c:4737:7
#2 resquery_send lib/dns/resolver.c:2892:13
#3 fctx_query lib/dns/resolver.c:2202:12
#4 fctx_try lib/dns/resolver.c:4300:11
#5 resquery_connected lib/dns/resolver.c:3130:4
#6 dispatch lib/isc/task.c:1152:7
#7 run lib/isc/task.c:1344:2
Location is file descriptor 513 created by thread T2 at:
#0 connect <null>
#1 isc_socket_connect lib/isc/unix/socket.c:4737:7
#2 resquery_send lib/dns/resolver.c:2892:13
#3 fctx_query lib/dns/resolver.c:2202:12
#4 fctx_try lib/dns/resolver.c:4300:11
#5 resquery_connected lib/dns/resolver.c:3130:4
#6 dispatch lib/isc/task.c:1152:7
#7 run lib/isc/task.c:1344:2
Mutex M1 (0x000000000016) created at:
#0 pthread_mutex_init <null>
#1 isc__mutex_init lib/isc/pthreads/mutex.c:288:8
#2 setup_thread lib/isc/unix/socket.c:3584:3
#3 isc_socketmgr_create2 lib/isc/unix/socket.c:3825:3
#4 create_managers bin/named/main.c:932:11
#5 setup bin/named/main.c:1223:11
#6 main bin/named/main.c:1523:2
Mutex M2 is already destroyed.
Thread T1 'isc-socket-1' (running) created by main thread at:
#0 pthread_create <null>
#1 isc_thread_create lib/isc/pthreads/thread.c:73:8
#2 isc_socketmgr_create2 lib/isc/unix/socket.c:3826:3
#3 create_managers bin/named/main.c:932:11
#4 setup bin/named/main.c:1223:11
#5 main bin/named/main.c:1523:2
Thread T2 (running) created by main thread at:
#0 pthread_create <null>
#1 isc_thread_create lib/isc/pthreads/thread.c:73:8
#2 isc_taskmgr_create lib/isc/task.c:1434:3
#3 create_managers bin/named/main.c:915:11
#4 setup bin/named/main.c:1223:11
#5 main bin/named/main.c:1523:2
SUMMARY: ThreadSanitizer: data race in epoll_ctl
(cherry picked from commit c37b251e)
Closes #2162 (closed)