]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Merge pull request #14040 from rgacogne/ddist19-revert-14004 dnsdist-1.9.3
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 5 Apr 2024 10:49:59 +0000 (12:49 +0200)
committerGitHub <noreply@github.com>
Fri, 5 Apr 2024 10:49:59 +0000 (12:49 +0200)
dnsdist-1.9.x: Revert "dnsdist: Release failed TCP backend connections more quickly"

pdns/dnsdistdist/dnsdist-tcp-downstream.cc
pdns/dnsdistdist/test-dnsdisttcp_cc.cc

index 75e061b331682716c565ee194c1fe1cafaf4870c..904913e3eeda61b9c6aba7045edbe21a7819fbb8 100644 (file)
@@ -146,13 +146,6 @@ void TCPConnectionToBackend::release(){
   if (d_ioState) {
     d_ioState.reset();
   }
-
-  auto shared = std::dynamic_pointer_cast<TCPConnectionToBackend>(shared_from_this());
-  if (!willBeReusable(true)) {
-    /* remove ourselves from the connection cache, this might mean that our
-       reference count drops to zero after that, so we need to be careful */
-    t_downstreamTCPConnectionsManager.removeDownstreamConnection(shared);
-  }
 }
 
 static uint32_t getSerialFromRawSOAContent(const std::vector<uint8_t>& raw)
index 3428950f4b725e1078f018c47c928df811246e93..22a27c692c1a07c021710046547bfda7572d785f 100644 (file)
@@ -3624,8 +3624,8 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     g_tcpRecvTimeout = 2;
 
     /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
-    /* we have no connection to clear, because there was a timeout! */
-    BOOST_CHECK_EQUAL(IncomingTCPConnectionState::clearAllDownstreamConnections(), 0U);
+    /* we have one connection to clear, no proxy protocol */
+    BOOST_CHECK_EQUAL(IncomingTCPConnectionState::clearAllDownstreamConnections(), 1U);
   }
 
   {