This commit ensures that the non-atomic flags inside a DoH listener
socket object (and associated worker) are accessed when doing accept
for a connection only from within the context of the dedicated thread,
but not other worker threads.
The purpose of this commit is to avoid TSAN errors during
isc__nmsocket_closing() calls. It is a continuation of
4b5559cd8f41e67bf03e92d9d0338dee9d549b48.
* function gets invoked, so we need to do extra sanity checks to
* detect this case.
*/
- if (isc__nmsocket_closing(handle->sock) || httpserver == NULL) {
+ if (isc__nm_closing(handle->sock->worker)) {
+ return (ISC_R_SHUTTINGDOWN);
+ } else if (isc__nmsocket_closing(handle->sock) || httpserver == NULL) {
return (ISC_R_CANCELED);
}
REQUIRE(VALID_NMSOCK(httplistensock));
INSIST(httplistensock == httpserver);
- if (isc__nmsocket_closing(httplistensock) ||
- !atomic_load(&httplistensock->listening))
- {
+ if (atomic_load(&httplistensock->closing)) {
return (ISC_R_CANCELED);
}