]> granicus.if.org Git - pdns/commitdiff
improve logging of errors in carbon & web services thread
authorbert hubert <bert.hubert@powerdns.com>
Tue, 10 Oct 2017 13:50:22 +0000 (15:50 +0200)
committerbert hubert <bert.hubert@powerdns.com>
Tue, 10 Oct 2017 13:50:22 +0000 (15:50 +0200)
pdns/rec-carbon.cc
pdns/ws-recursor.cc

index 290750930a55346ee47e37351882cb5a6fb7055d..5cf085ba9e816b2767a5d5a13863e7bf703cbcd4 100644 (file)
@@ -73,3 +73,7 @@ catch(std::exception& e)
 {
   L<<Logger::Error<<"Error in carbon thread: "<<e.what()<<endl;
 }
+catch(...)
+{
+  L<<Logger::Error<<"Unknown error in carbon thread"<<endl;
+}
index e54d81258628fe5c1cfdcfce679ff1589eccf7cd..4ffa219bdadbaac750f26ef0fe656bd59b3c2fba 100644 (file)
@@ -539,15 +539,23 @@ void RecursorWebServer::jsonstat(HttpRequest* req, HttpResponse *resp)
 
 void AsyncServerNewConnectionMT(void *p) {
   AsyncServer *server = (AsyncServer*)p;
+  
   try {
-    auto socket = server->accept();
+    auto socket = server->accept(); // this is actually a shared_ptr
     if (socket) {
       server->d_asyncNewConnectionCallback(socket);
     }
   } catch (NetworkError &e) {
     // we're running in a shared process/thread, so can't just terminate/abort.
+    L<<Logger::Error<<"Network error in web thread: "<<e.what()<<endl;
     return;
   }
+  catch (...) {
+    L<<Logger::Error<<"Unknown error in web thread: "<<endl;
+
+    return;
+  }
+
 }
 
 void AsyncServer::asyncWaitForConnections(FDMultiplexer* fdm, const newconnectioncb_t& callback)