From: Otto Moerbeek Date: Fri, 17 Mar 2023 10:35:55 +0000 (+0100) Subject: Prevent data race by initing NOD protobuf tag values not in the NOD threads but in... X-Git-Tag: auth-4.8.0-alpha1~2^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F12660%2Fhead;p=thirdparty%2Fpdns.git Prevent data race by initing NOD protobuf tag values not in the NOD threads but in the main thread --- diff --git a/pdns/recursordist/rec-main.cc b/pdns/recursordist/rec-main.cc index 7a5beab8be..82365a9135 100644 --- a/pdns/recursordist/rec-main.cc +++ b/pdns/recursordist/rec-main.cc @@ -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 */