]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Prevent data race by initing NOD protobuf tag values not in the NOD threads but in... 12660/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 17 Mar 2023 10:35:55 +0000 (11:35 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 17 Mar 2023 10:35:55 +0000 (11:35 +0100)
pdns/recursordist/rec-main.cc

index 7a5beab8be526b35be0e4a295c6584083fe14947..82365a91350c2fecdb9271bb3261d5f77d924564 100644 (file)
@@ -746,7 +746,6 @@ static void setupNODThread(Logr::log_t log)
     }
     std::thread t(nod::NODDB::startHousekeepingThread, t_nodDBp, std::this_thread::get_id());
     t.detach();
-    g_nod_pbtag = ::arg()["new-domain-pb-tag"];
   }
   if (g_udrEnabled) {
     uint32_t num_cells = ::arg().asNum("unique-response-db-size");
@@ -766,7 +765,6 @@ static void setupNODThread(Logr::log_t log)
     }
     std::thread t(nod::UniqueResponseDB::startHousekeepingThread, t_udrDBp, std::this_thread::get_id());
     t.detach();
-    g_udr_pbtag = ::arg()["unique-response-pb-tag"];
   }
 }
 
@@ -791,6 +789,8 @@ static void setupNODGlobal()
   // Setup Unique DNS Response subsystem
   g_udrEnabled = ::arg().mustDo("unique-response-tracking");
   g_udrLog = ::arg().mustDo("unique-response-log");
+  g_nod_pbtag = ::arg()["new-domain-pb-tag"];
+  g_udr_pbtag = ::arg()["unique-response-pb-tag"];
 }
 #endif /* NOD_ENABLED */