]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Add warning about trying to get the lock instead of waiting
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 6 Jan 2021 10:41:13 +0000 (11:41 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 22 Feb 2021 17:43:07 +0000 (18:43 +0100)
pdns/recursordist/aggressive_nsec.cc

index d6bbef640121081aef83c1a2c68932a202719437..fdac6802ebb4996de99c68ef1e646f218bea8a7b 100644 (file)
@@ -35,6 +35,7 @@ std::shared_ptr<AggressiveNSECCache::ZoneEntry> AggressiveNSECCache::getBestZone
 {
   std::shared_ptr<AggressiveNSECCache::ZoneEntry> entry{nullptr};
   {
+    #warning tryreadlock?
     ReadLock rl(d_lock);
     auto got = d_zones.lookup(zone);
     if (got) {
@@ -205,8 +206,9 @@ void AggressiveNSECCache::insertNSEC(const DNSName& zone, const DNSName& owner,
   ++d_entriesCount;
 }
 
-bool AggressiveNSECCache::getNSECBefore(time_t now, std::shared_ptr<AggressiveNSECCache::ZoneEntry>& zoneEntry, const DNSName& name, ZoneEntry::CacheEntry& entry) {
-
+bool AggressiveNSECCache::getNSECBefore(time_t now, std::shared_ptr<AggressiveNSECCache::ZoneEntry>& zoneEntry, const DNSName& name, ZoneEntry::CacheEntry& entry)
+{
+  #warning try?
   std::lock_guard<std::mutex> lock(zoneEntry->d_lock);
   if (zoneEntry->d_entries.empty()) {
     return false;
@@ -260,8 +262,9 @@ bool AggressiveNSECCache::getNSECBefore(time_t now, std::shared_ptr<AggressiveNS
   return true;
 }
 
-bool AggressiveNSECCache::getNSEC3(time_t now, std::shared_ptr<AggressiveNSECCache::ZoneEntry>& zoneEntry, const DNSName& name, ZoneEntry::CacheEntry& entry) {
-
+bool AggressiveNSECCache::getNSEC3(time_t now, std::shared_ptr<AggressiveNSECCache::ZoneEntry>& zoneEntry, const DNSName& name, ZoneEntry::CacheEntry& entry)
+{
+  #warning try?
   std::lock_guard<std::mutex> lock(zoneEntry->d_lock);
   if (zoneEntry->d_entries.empty()) {
     return false;