]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Properly account the failure to forward a query to a backend 13834/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 18 Mar 2024 15:16:17 +0000 (16:16 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 18 Mar 2024 15:16:17 +0000 (16:16 +0100)
pdns/dnsdistdist/dnsdist.cc

index f836e1320000fde364cd07807669a78ec90404ad..06dc4781189daf73d407e448a24612d8a8034985 100644 (file)
@@ -1260,8 +1260,11 @@ ssize_t udpClientSendRequestToBackend(const std::shared_ptr<DownstreamState>& ba
        We don't want to reconnect the real socket if the healthcheck failed,
        because it's not using the same socket.
     */
-    if (!healthCheck && (savederrno == EINVAL || savederrno == ENODEV || savederrno == ENETUNREACH || savederrno == EBADF)) {
-      backend->reconnect();
+    if (!healthCheck) {
+      if (savederrno == EINVAL || savederrno == ENODEV || savederrno == ENETUNREACH || savederrno == EBADF) {
+        backend->reconnect();
+      }
+      backend->reportTimeoutOrError();
     }
   }