]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: dns: detect the server's shutdown on a partial TCP response
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 18 Nov 2026 13:53:37 +0000 (14:53 +0100)
committerOlivier Houchard <cognet@ci0.org>
Wed, 18 Nov 2026 13:39:03 +0000 (14:39 +0100)
commit44c1cdc8f5f8fdd0541e185a83149001183dd997
treed7690885f0b4b39fca94e84689bec8d9af14aa76
parent973c07763ef5f0c7d50b7c77fb9bcfefbc1ef997
BUG/MINOR: dns: detect the server's shutdown on a partial TCP response

When a DNS response is only partially received over TCP, the session's
I/O handler reads the available data with applet_getblk() and waits for
more. When nothing new is available, the requested length is zero, and
applet_getblk() never reports the shutdown in this case since
applet_may_get() only checks it when more data than available is
requested. If the server closes after sending part of a response, the
session then waits for data that will never come, and queries assigned
to it are lost until it times out, about 20s later.

Let's check for the shutdown when the message is incomplete: the rest
cannot come anymore. This was brought in 3.3 by commit 217da087f
("MEDIUM: dns: Update the dns_session applet to use its own buffers").
It must be backported to 3.3.
src/dns.c