]> granicus.if.org Git - pdns/commitdiff
with this change, a crash because of a PDNSException in qthread gets turned into...
authorbert hubert <bert.hubert@powerdns.com>
Mon, 6 Mar 2017 15:10:42 +0000 (16:10 +0100)
committerbert hubert <bert.hubert@powerdns.com>
Mon, 6 Mar 2017 15:10:42 +0000 (16:10 +0100)
pdns/common_startup.cc

index 1fa7275715993a8bc72a5b67868531c91ae981b9..41197b337591fbd6a2974803ee6c82a92c673535 100644 (file)
@@ -343,6 +343,7 @@ void sendout(DNSPacket* a)
 
 //! The qthread receives questions over the internet via the Nameserver class, and hands them to the Distributor for further processing
 void *qthread(void *number)
+try
 {
   DNSPacket *P;
   DNSDistributor *distributor = DNSDistributor::Create(::arg().asNum("distributor-threads", 1)); // the big dispatcher!
@@ -456,6 +457,11 @@ void *qthread(void *number)
   }
   return 0;
 }
+catch(PDNSException& pe)
+{
+  L<<Logger::Error<<"Fatal error in question thread: "<<pe.reason<<endl;
+  _exit(1);
+}
 
 static void* dummyThread(void *)
 {