]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
A few more g_negache un-threading cases.
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 23 Sep 2020 14:06:32 +0000 (16:06 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 23 Sep 2020 14:51:25 +0000 (16:51 +0200)
pdns/pdns_recursor.cc
pdns/rec_channel_rec.cc
pdns/recursor_cache.cc
pdns/syncres.hh

index 2cd4a86dd68e40e5ffd392cb7c418e236a3cf61b..26641c74511fadb06cc48ae4ebd723ea9f1a2587 100644 (file)
@@ -3150,11 +3150,12 @@ static void doStats(void)
   uint64_t cacheSize = g_recCache->size();
   auto rc_stats = g_recCache->stats();
   double r = rc_stats.second == 0 ? 0.0 : (100.0 * rc_stats.first / rc_stats.second);
-  
+  uint64_t negCacheSize = g_negCache->size();
+
   if(g_stats.qcounter && (cacheHits + cacheMisses) && SyncRes::s_queries && SyncRes::s_outqueries) {
     g_log<<Logger::Notice<<"stats: "<<g_stats.qcounter<<" questions, "<<
       cacheSize << " cache entries, "<<
-      broadcastAccFunction<uint64_t>(pleaseGetNegCacheSize)<<" negative entries, "<<
+      negCacheSize<<" negative entries, "<<
       (int)((cacheHits*100.0)/(cacheHits+cacheMisses))<<"% cache hits"<<endl;
     g_log << Logger::Notice<< "stats: cache contended/acquired " << rc_stats.first << '/' << rc_stats.second << " = " << r << '%' << endl;
 
index 4cb3de9c7c775e665f8a27f58ff67fc454454499..a192962a232dbb22d99088987d5ab936632efb6c 100644 (file)
@@ -894,15 +894,9 @@ static uint64_t getThrottleSize()
   return broadcastAccFunction<uint64_t>(pleaseGetThrottleSize);
 }
 
-uint64_t* pleaseGetNegCacheSize()
-{
-  uint64_t tmp = g_negCache->size();
-  return new uint64_t(tmp);
-}
-
 static uint64_t getNegCacheSize()
 {
-  return broadcastAccFunction<uint64_t>(pleaseGetNegCacheSize);
+  return g_negCache->size();
 }
 
 static uint64_t* pleaseGetFailedHostsSize()
index 2748ea8013cf1db501376290997f6c7a7248fe1b..4f209d3147c098f40a2e9039ea36d1073954e83b 100644 (file)
@@ -386,9 +386,6 @@ void MemRecursorCache::replace(time_t now, const DNSName &qname, const QType& qt
   ce.d_records.clear();
   ce.d_records.reserve(content.size());
 
-  if (ce.d_qtype == QType::DNSKEY || ce.d_qtype == QType::SOA) {
-    maxTTD = now + 1;
-  }
   for(const auto& i : content) {
     /* Yes, we have altered the d_ttl value by adding time(nullptr) to it
        prior to calling this function, so the TTL actually holds a TTD. */
index 4b61031714cd37d0a4b879c357f22bc3a42fa809..616ebd0a84f4f8aba8c72724b6c018852544f659 100644 (file)
@@ -1096,7 +1096,6 @@ std::shared_ptr<SyncRes::domainmap_t> parseAuthAndForwards();
 uint64_t* pleaseGetNsSpeedsSize();
 uint64_t* pleaseGetFailedServersSize();
 uint64_t* pleaseGetEDNSStatusesSize();
-uint64_t* pleaseGetNegCacheSize();
 uint64_t* pleaseGetConcurrentQueries();
 uint64_t* pleaseGetThrottleSize();
 uint64_t* pleaseGetPacketCacheHits();