From 3d88c4c6a79fea29fbab1ed3d7db5c4fdde0d66c Mon Sep 17 00:00:00 2001 From: Kees Monshouwer Date: Wed, 22 Dec 2021 13:18:57 +0100 Subject: [PATCH] auth: improve tcp exception handling --- pdns/tcpreceiver.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pdns/tcpreceiver.cc b/pdns/tcpreceiver.cc index 9670c9a8bc..fb176452f6 100644 --- a/pdns/tcpreceiver.cc +++ b/pdns/tcpreceiver.cc @@ -415,11 +415,13 @@ void TCPNameserver::doConnection(int fd) } catch(std::exception &e) { - g_log<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(); -- 2.47.2