From b0b3480b98d41db821f681183f45d5d08db02f93 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Mon, 18 Mar 2024 16:16:17 +0100 Subject: [PATCH] dnsdist: Properly account the failure to forward a query to a backend --- pdns/dnsdistdist/dnsdist.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pdns/dnsdistdist/dnsdist.cc b/pdns/dnsdistdist/dnsdist.cc index f836e13200..06dc478118 100644 --- a/pdns/dnsdistdist/dnsdist.cc +++ b/pdns/dnsdistdist/dnsdist.cc @@ -1260,8 +1260,11 @@ ssize_t udpClientSendRequestToBackend(const std::shared_ptr& 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(); } } -- 2.47.2