]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: improve tcp exception handling 11122/head
authorKees Monshouwer <mind04@monshouwer.org>
Wed, 22 Dec 2021 12:18:57 +0000 (13:18 +0100)
committermind04 <mind04@monshouwer.org>
Wed, 22 Dec 2021 13:38:14 +0000 (14:38 +0100)
pdns/tcpreceiver.cc

index 9670c9a8bc4f392371d55a1c70a51a2c06d587b5..fb176452f68ba30d1c91b880e0e03093a10ea3ae 100644 (file)
@@ -415,11 +415,13 @@ void TCPNameserver::doConnection(int fd)
   }
 
   catch(std::exception &e) {
-    g_log<<Logger::Error<<"TCP Connection Thread died because of STL error: "<<e.what()<<endl;
+    s_P.lock()->reset(); // on next call, backend will be recycled
+    g_log << Logger::Error << "TCP Connection Thread died because of STL error, cycling backend: " << e.what() << endl;
   }
   catch( ... )
   {
-    g_log << Logger::Error << "TCP Connection Thread caught unknown exception." << endl;
+    s_P.lock()->reset(); // on next call, backend will be recycled
+    g_log << Logger::Error << "TCP Connection Thread caught unknown exception, cycling backend." << endl;
   }
   d_connectionroom_sem->post();