]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: resolvers: count nameserver timeouts
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 29 Sep 2026 07:38:46 +0000 (09:38 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 10 Nov 2026 14:47:52 +0000 (15:47 +0100)
commit745413eed1769d8dda7eabbd22ad44bfe08147ad
tree65a5ff93d7a9bf67e0f2028ef44128525b4f6bed
parent77be1f07882289b98b24a709298d87153a026928
BUG/MINOR: resolvers: count nameserver timeouts

The per-nameserver "timeout" counter, reported by "show resolvers", the
stats and Prometheus, and documented as the number of times the server
did not answer in time, has never been incremented since it was
introduced in 1.6, so it always reports zero, even when a nameserver
never responds.

Individual responses are not tracked per nameserver for a given query,
so we cannot know which nameservers did not respond when only some did.
However when a try expires without any response at all, all nameservers
the query was sent to failed to respond in time. Let's count a timeout
for each of them in this case. It may undercount timeouts of some
nameservers when others respond, but it's never wrong anymore when
none responds, which is by far the most useful case.

This can be verified with a nameserver which never responds and
"resolve_retries 2": after 3 seconds, "show resolvers" reports
"sent: 5" and "timeout: 0" before this patch, and "timeout: 4" after.

This patch may be backported to stable branches.
src/resolvers.c