From: Remi Gacogne Date: Fri, 1 Oct 2021 13:16:25 +0000 (+0200) Subject: dnsdist: Try to work around a TSAN false positive X-Git-Tag: auth-4.6.0-alpha1~8^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F10787%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Try to work around a TSAN false positive tcpMaxConcurrentConnections is an indicative metric, we don't really care if there is a small race here. --- diff --git a/pdns/dnsdist-tcp.cc b/pdns/dnsdist-tcp.cc index a8d8971154..cf69ed1d89 100644 --- a/pdns/dnsdist-tcp.cc +++ b/pdns/dnsdist-tcp.cc @@ -1323,8 +1323,8 @@ void tcpAcceptorThread(ClientState* cs) continue; } - if (concurrentConnections > cs->tcpMaxConcurrentConnections) { - cs->tcpMaxConcurrentConnections = concurrentConnections; + if (concurrentConnections > cs->tcpMaxConcurrentConnections.load()) { + cs->tcpMaxConcurrentConnections.store(concurrentConnections); } if (ci->fd < 0) { diff --git a/pdns/dnsdistdist/doh.cc b/pdns/dnsdistdist/doh.cc index 6301727a37..5737b7fb6e 100644 --- a/pdns/dnsdistdist/doh.cc +++ b/pdns/dnsdistdist/doh.cc @@ -1369,8 +1369,8 @@ static void on_accept(h2o_socket_t *listener, const char *err) return; } - if (concurrentConnections > dsc->cs->tcpMaxConcurrentConnections) { - dsc->cs->tcpMaxConcurrentConnections = concurrentConnections; + if (concurrentConnections > dsc->cs->tcpMaxConcurrentConnections.load()) { + dsc->cs->tcpMaxConcurrentConnections.store(concurrentConnections); } auto& conn = t_conns[descriptor];