]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: resolvers: do not run the timeout task when there's no resolution
authorWilly Tarreau <w@1wt.eu>
Mon, 21 Nov 2022 18:15:22 +0000 (19:15 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 21 Nov 2022 18:21:07 +0000 (19:21 +0100)
commitfdecaf6ae49b9fef923cba7c3f20d395ed6d72f2
treec8d830cbea6dd951cd5f458e1fa0f648b61ac653
parent28ea31c7cb219bf6f85533b3ef57edfecba821d8
BUG/MINOR: resolvers: do not run the timeout task when there's no resolution

The function resolv_update_resolvers_timeout() always schedules a wakeup
of the process_resolvers() task based on the "timeout resolve" setting,
regardless of the presence of an ongoing resolution or not. This is causing
one wakeup every second by default even when there's no resolvers section
(due to the default one), and can even be worse: creating a section with
"timeout resolve 1" bombs the process with 1000 wakeups per second.

Let's condition the setting to the presence of a resolution to address
this.

This issue has been there forever, but it doesn't cause that much trouble,
and given how fragile and tricky this code is, it's probably wise to
refrain from backporting it until it's reported to really cause trouble.
src/resolvers.c