]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Tweaks
authorOtto <otto.moerbeek@open-xchange.com>
Tue, 21 Sep 2021 08:46:14 +0000 (10:46 +0200)
committerOtto <otto.moerbeek@open-xchange.com>
Tue, 21 Sep 2021 09:54:50 +0000 (11:54 +0200)
pdns/pdns_recursor.cc
pdns/rec-lua-conf.cc
pdns/rec-lua-conf.hh

index 66dd782918ef9f22a24e2a2b3a9b9ecf68d64244..186e01de1af386c27cdcf87b5af6e749ab760cbb 100644 (file)
@@ -5289,6 +5289,7 @@ static int serviceMain(int argc, char*argv[])
   }
 
   startLuaConfigDelayedThreads(delayedLuaThreads, g_luaconfs.getCopy().generation);
+  delayedLuaThreads.rpzPrimaryThreads.clear(); // no longer needed
 
   makeThreadPipes();
 
index 65ebc3a1290a0c74e2f6fb2eceb995f8659b932a..bb315ed7b1c58ddd9c00b507b0ff98a991a01f5b 100644 (file)
@@ -626,6 +626,8 @@ void startLuaConfigDelayedThreads(const luaConfigDelayedThreads& delayedThreads,
 {
   for (const auto& rpzPrimary : delayedThreads.rpzPrimaryThreads) {
     try {
+      // The get calls all return a value object here. That is esential, since we want copies so that RPZIXFRTracker gets values
+      // with the proper lifetime.
       std::thread t(RPZIXFRTracker, std::get<0>(rpzPrimary), std::get<1>(rpzPrimary), std::get<2>(rpzPrimary), std::get<3>(rpzPrimary), std::get<4>(rpzPrimary), std::get<5>(rpzPrimary), std::get<6>(rpzPrimary) * 1024 * 1024, std::get<7>(rpzPrimary), std::get<8>(rpzPrimary), std::get<9>(rpzPrimary), std::get<10>(rpzPrimary), std::get<11>(rpzPrimary), generation);
       t.detach();
     }
index 4b1fc27dd272fd362bd65e92004391c7fd27f301..cc03bf99a26f9da14915c5487ccb3c610a8168bf 100644 (file)
@@ -85,6 +85,7 @@ extern GlobalStateHolder<LuaConfigItems> g_luaconfs;
 
 struct luaConfigDelayedThreads
 {
+  // Please make sure that the tuple below only contains value types since they are used as parameters in a thread ct
   std::vector<std::tuple<std::vector<ComboAddress>, boost::optional<DNSFilterEngine::Policy>, bool, uint32_t, size_t, TSIGTriplet, size_t, ComboAddress, uint16_t, uint32_t, std::shared_ptr<SOARecordContent>, std::string> > rpzPrimaryThreads;
 };