]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: followup to 16662: more cases of tsan annotations 16736/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 19 Jan 2026 11:00:50 +0000 (12:00 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 19 Jan 2026 11:00:50 +0000 (12:00 +0100)
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
pdns/recursordist/pdns_recursor.cc

index b0f2757d3a1eb8ce6ffa5c2dbac6fdfe2b4a35b5..df1be5b6a4d7b5f9224aa866f89f158b4feb0793 100644 (file)
@@ -2124,7 +2124,10 @@ void requestWipeCaches(const DNSName& canon)
   ThreadMSG* tmsg = new ThreadMSG(); // NOLINT: pointer owner
   tmsg->func = [=] { return pleaseWipeCaches(canon, true, 0xffff); };
   tmsg->wantAnswer = false;
+  __tsan_release(tmsg);
+
   if (write(RecThreadInfo::info(0).getPipes().writeToThread, &tmsg, sizeof(tmsg)) != sizeof(tmsg)) { // NOLINT: correct sizeof
+    __tsan_acquire(tmsg);
     delete tmsg; // NOLINT: pointer owner
 
     unixDie("write to thread pipe returned wrong size or error");
@@ -2889,6 +2892,7 @@ void distributeAsyncFunction(const string& packet, const pipefunc_t& func)
   ThreadMSG* tmsg = new ThreadMSG(); // NOLINT: pointer ownership
   tmsg->func = func;
   tmsg->wantAnswer = false;
+  __tsan_release(tmsg);
 
   if (!trySendingQueryToWorker(target, tmsg)) {
     /* if this function failed but did not raise an exception, it means that the pipe
@@ -2900,6 +2904,7 @@ void distributeAsyncFunction(const string& packet, const pipefunc_t& func)
 
     if (!trySendingQueryToWorker(newTarget, tmsg)) {
       t_Counters.at(rec::Counter::queryPipeFullDrops)++;
+      __tsan_acquire(tmsg);
       delete tmsg; // NOLINT: pointer ownership
     }
   }