]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Avoid abort if database server goes away
authorChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Thu, 29 Oct 2020 11:54:43 +0000 (12:54 +0100)
committerChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Sat, 15 May 2021 22:45:45 +0000 (00:45 +0200)
pdns/common_startup.cc

index 111a75a39c39a694849316e3bcbc394e95895621..82ca91a4ffc383e3452fea735724c3714890651f 100644 (file)
@@ -687,9 +687,17 @@ void mainthread()
 
     domainCacheUpdateSince += slept;
     if (domainCacheUpdateSince >= g_domainCache.getTTL()) {
-      domainCacheUpdateSince = 0;
-      UeberBackend B;
-      B.updateDomainCache();
+      try {
+        UeberBackend B;
+        B.updateDomainCache();
+        domainCacheUpdateSince = 0;
+      }
+      catch(PDNSException &e) {
+        g_log<<Logger::Error<<"PDNSException while updating domain cache: "<<e.reason<<endl;
+      }
+      catch(std::exception &e) {
+        g_log<<Logger::Error<<"STL Exception while updating domain cache: "<<e.what()<<endl;
+      }
     }
 
     secpollSince += slept;