]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: resolvers: Use tick_first() to update the resolvers task timeout
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 14 Dec 2022 09:26:25 +0000 (10:26 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 14 Dec 2022 09:44:17 +0000 (10:44 +0100)
commit819d48b14e7edcebc737e5fc7d4f1b269c07bc5d
tree014a6b848c1be1608c89870a6cbd97660f820669
parent427293420fe5358539a395a2a843c8707582871d
BUG/MEDIUM: resolvers: Use tick_first() to update the resolvers task timeout

In resolv_update_resolvers_timeout(), the resolvers task timeout is updated
by checking running and waiting resolutions. However, to find the next
wakeup date, MIN() operator is used to compare ticks. Ticks must never be
compared with such operators, tick helper functions must be used, to
properly handled TICK_ETERNITY value. In this case, tick_first() must be
used instead of MIN().

It is an old bug but it is pretty visible since the commit fdecaf6ae4
("BUG/MINOR: resolvers: do not run the timeout task when there's no
resolution"). Because of this bug, the resolvers task timeout may be set to
TICK_ETERNITY, stopping periodic resolutions.

This patch should solve the issue #1962. It must be backported to all stable
versions.
src/resolvers.c