BUG/MINOR: resolvers: Wait the resolution execution for a do_resolv action
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 11 Jan 2023 09:31:10 +0000 (10:31 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 11 Jan 2023 09:31:42 +0000 (10:31 +0100)
commit51dbb4cb798ca52167041790783030bcebda98b1
treeabc024bd127947221aa7a2f3fc735076e6038717
parent0ae2e63d85d1da9c20b2a8b511cd8ced8558e769
BUG/MINOR: resolvers: Wait the resolution execution for a do_resolv action

The do_resolv action triggers a resolution and must wait for the
result. Concretely, if no cache entry is available, it creates a resolution
and wakes up the resolvers task. Then it yields. When the action is
recalled, if the resolution is still running, it yields again.

However, if the resolution is not running, it does not check it was
running. Thus, it is possible to ignore the resolution because the action
was recalled before the resolvers task had a chance to be executed. If there
is result, the action must yield.

This patch should fix the issue #1993. It must be backported as far as 2.0.
src/resolvers.c