]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: resolvers: Stop scheduling resolution during stopping stage
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 16 May 2023 16:28:57 +0000 (18:28 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 17 May 2023 14:48:33 +0000 (16:48 +0200)
commit06e9c81bd078b14dfc7d728b027fe42e5dc4755c
treec5dd1d70572162e89b22b4a049744e8dcfd7068d
parent8bca3cc8c766cada51805631fb1f72475b89bc44
MEDIUM: resolvers: Stop scheduling resolution during stopping stage

When the process is stopping, the server resolutions are suspended. However
the task is still periodically woken up for nothing. If there is a huge
number of resolution, it may lead to a noticeable CPU consumption for no
reason.

To avoid this extra CPU cost, we stop to schedule the the resolution tasks
during the stopping stage. Of course, it is only true for server
resolutinos. Dynamic ones, via do-resolve actions, are not concerned. These
ones must still be triggered during stopping stage.

Concretly, during the stopping stage, the resolvers task is no longer
scheduled if there is no running resolutions. In this case, if a do-resolve
action is evaluated, the task is woken up.

This patch should partially solve the issue #2145.
src/resolvers.c