]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: resolvers: reject null "timeout resolve" and "timeout retry" values
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 29 Sep 2026 07:26:38 +0000 (09:26 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 10 Nov 2026 14:47:52 +0000 (15:47 +0100)
commitb5232b12f79b0365c99414f44c9df0c0f473936b
treee8634b2ef8ae5c74086b1555fd7ddc54eeb511c2
parent2f46186d8720980afd3348ee3256acc4716ef257
BUG/MINOR: resolvers: reject null "timeout resolve" and "timeout retry" values

Both timeouts are parsed with parse_time_err() which accepts zero. But
"timeout resolve" is the delay between two resolutions of a same name,
so with a null value, a resolution is restarted as soon as it completes,
from the same task wakeup, and the resolvers task spins at 100% CPU
flooding the nameservers. With a null "timeout retry", all retries of a
resolution are sent at once without waiting for any response, which
defeats their purpose.

This can be reproduced with "timeout resolve 0ms" (which doesn't even
emit the "suspiciously small" warning thanks to the unit) and a server
resolving a name answered by the nameserver: 68225 queries were sent in
2 seconds, versus 2 with "timeout resolve 1s".

Let's reject null values for these two timeouts.

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