From 64710754ee721e9105c7838cf0e050a6405d0bdf Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Mon, 25 Oct 2021 10:17:55 +0200 Subject: [PATCH] dnsdist: Add an error message on a DoH internal pipe short read --- pdns/dnsdistdist/doh.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pdns/dnsdistdist/doh.cc b/pdns/dnsdistdist/doh.cc index 51be96680d..418d53a404 100644 --- a/pdns/dnsdistdist/doh.cc +++ b/pdns/dnsdistdist/doh.cc @@ -1296,7 +1296,8 @@ static void on_dnsdist(h2o_socket_t *listener, const char *err) /* we want to read as many responses from the pipe as possible before giving up. Even if we are overloaded and fighting with the DoH connections for the CPU, the first thing we need to do is to send responses to free slots - anyway. */ + anyway, otherwise queries and responses are piling up in our pipes, consuming + memory and likely coming up too late after the client has gone away */ while (true) { DOHUnit *du = nullptr; DOHServerConfig* dsc = reinterpret_cast(listener->data); @@ -1304,11 +1305,12 @@ static void on_dnsdist(h2o_socket_t *listener, const char *err) if (got < 0) { if (errno != EWOULDBLOCK && errno != EAGAIN) { - warnlog("Error reading a DOH internal response: %s", strerror(errno)); + errlog("Error reading a DOH internal response: %s", strerror(errno)); } return; } else if (static_cast(got) != sizeof(du)) { + errlog("Error reading a DoH internal response, got %d bytes instead of the expected %d", got, sizeof(du)); return; } @@ -1334,6 +1336,7 @@ static void on_dnsdist(h2o_socket_t *listener, const char *err) } else { du->release(); + vinfolog("Unable to pass DoH query to a TCP worker thread after getting a TC response over UDP"); continue; } } -- 2.47.2