]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Try to work around a TSAN false positive 10787/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 1 Oct 2021 13:16:25 +0000 (15:16 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 1 Oct 2021 13:16:25 +0000 (15:16 +0200)
tcpMaxConcurrentConnections is an indicative metric, we don't really
care if there is a small race here.

pdns/dnsdist-tcp.cc
pdns/dnsdistdist/doh.cc

index a8d8971154914bc33d0ef34c60cadda51420c98d..cf69ed1d89e4dda0b997a30ce8a22976d958c33f 100644 (file)
@@ -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) {
index 6301727a37a8dbfde1a748db5e7aca6a810cdfff..5737b7fb6ed379f07be6d2c4407ea58ccd82b43f 100644 (file)
@@ -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];